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

Translation of the groupBy expression of a sugared $group is unimplemented

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • ALL
    • Hide

      A minimal repro for $bucket:

      > db.t.insert({a: 1, b: 2})
      > db.t.aggregate([{$bucket: {"groupBy": {$and: ["$a", 2]}, boundaries: [0, 1], default: 1}}])
      

      Notice that $bucket without an $and for the groupBy does not produce the error and group can be pushed down and executes correctly,

      db.t.aggregate([{$bucket: {"groupBy": "$a", boundaries: [false, true], default: 1}}])
      

      A minimal repro for $sortByCount:

      > db.t.aggregate([{$sortByCount: {$and: ["$a", 1]}}])
      
      Show
      A minimal repro for $bucket: > db.t.insert({a: 1, b: 2}) > db.t.aggregate([{$bucket: {"groupBy": {$and: ["$a", 2]}, boundaries: [0, 1], default: 1}}]) Notice that $bucket without an $and for the groupBy does not produce the error and group can be pushed down and executes correctly, db.t.aggregate([{$bucket: {"groupBy": "$a", boundaries: [false, true], default: 1}}]) A minimal repro for $sortByCount: > db.t.aggregate([{$sortByCount: {$and: ["$a", 1]}}])
    • QE 2021-10-04

          Assignee:
          yoonsoo.kim@mongodb.com Yoon Soo Kim (Inactive)
          Reporter:
          eric.cox@mongodb.com Eric Cox (Inactive)
          Votes:
          0 Vote for this issue
          Watchers:
          3 Start watching this issue

            Created:
            Updated:
            Resolved: