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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical - P2
    • Resolution: Fixed
    • 6.0.1, 6.1.0-rc2
    • 6.0.2, 6.1.0-rc3, 6.2.0-rc0
    • None
    • Fully Compatible
    • ALL
    • v6.1, v6.0
    • QE 2022-09-19

    Description

      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]}}
        }}
      ]);
      

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: