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

setQuerySettings fails on aggregate queries containing $bucket

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 8.0.0-rc0
    • Component/s: None
    • None
    • Query Execution
    • ALL

      Trying to call setQuerySettings on the following aggregate query

      // Test that $bucket accepts a default value that falls outside the boundaries according to the
      // collation.
      results = coll.aggregate([{
                        $bucket: {
                            groupBy: "$num",
                            boundaries: ["100", "999"],
                            default: "2"  // Would fall between 100 and 999 if using the simple collation.
                        }
                    }])
                    .toArray(); 

      will result in the following error

      {
          "ok" : 0,
          "errmsg" : "The $bucket 'default' field must be less than the lowest boundary or greater than or equal to the highest boundary.",
          "code" : 40199,
          "codeName" : "Location40199",
          "$clusterTime" : {
              "clusterTime" : Timestamp(1712858859, 25),
              "signature" : {
                  "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
                  "keyId" : NumberLong(0)
              }
          },
          "operationTime" : Timestamp(1712858859, 25)
      } 

      [Parsley logs

       

            Assignee:
            catalin.sumanaru@mongodb.com Catalin Sumanaru
            Reporter:
            catalin.sumanaru@mongodb.com Catalin Sumanaru
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: