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

aggregation expressions don't accept BSON decimal as numeric type

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Query 2020-06-29, Query 2020-07-13
    • Linked BF Score:
      44

      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

            Assignee:
            junhson.jean-baptiste Junhson Jean-Baptiste (Inactive)
            Reporter:
            asya Asya Kamsky
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: