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

[SBE] Undefined slot error for $group with $cond / $switch / $ifNull expressions

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Critical - P2 Critical - P2
    • 6.0.2, 6.1.0-rc3, 6.2.0-rc0
    • Affects Version/s: 6.0.1, 6.1.0-rc2
    • Component/s: None
    • Fully Compatible
    • ALL
    • v6.1, v6.0
    • QE 2022-09-19

      We get undefined accessor error for the following pipeline.

      db.b.explain().aggregate([
        {$match: { master: 1} },
        {$group: {"_id":"$status", "counter":{$sum:1}}},
        {$group: {
          "_id": null,
          "pending":{$sum: {$cond:[{$lte:["$_id",99]},"$count",0]}},
          "running":{$sum: {$cond:[{$gte:["$_id",100]},"$count",0]}}
        }}
      ]);
      

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

              Created:
              Updated:
              Resolved: