Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-37068

aggregation expressions don't accept BSON decimal as numeric type

    XMLWordPrintable

    Details

    • Operating System:
      ALL

      Description

      db.foo.aggregate({$addFields:{x:{$substr:[{$literal:"xxxxxxxx"}, 0, NumberDecimal("5")]}}})
      2018-09-10T14:40:15.878-0400 E QUERY    [js] Error: command failed: {
      	"ok" : 0,
      	"errmsg" : "$substrBytes:  length must be a numeric type (is BSON type decimal)",
      	"code" : 16035,
      	"codeName" : "Location16035"
      } : aggregate failed 
       
      // same for other string functions
      [js] Error: command failed: {
          "ok" : 0,
          "errmsg" : "$substrBytes:  length must be a numeric type (is BSON type decimal)",
          "code" : 16035,
          "codeName" : "Location16035"
      } : aggregate failed :
      

      Decimal should be treated like other numeric types and be valid.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated: