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

aggregation expressions don't accept BSON decimal as numeric type

    • Fully Compatible
    • ALL
    • Query 2020-06-29, Query 2020-07-13
    • 44

      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.

            Assignee:
            junhson.jean-baptiste@mongodb.com Junhson Jean-Baptiste (Inactive)
            Reporter:
            asya.kamsky@mongodb.com Asya Kamsky
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: