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

SBE $shift window function should return default value when field missing

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0, 8.0.0-rc9
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • Fully Compatible
    • ALL
    • v8.0
    • 200

      Minimal repro:

      db.coll.drop();
      db.coll.insert([{_id: 1}, {_id: 2}]);
      const results = db.coll.aggregate([{$setWindowFields: {sortBy: {"_id": 1}, output: {"a": {$shift: {output: "$b", by: 1, default: "c"}}}}}]).toArray();
      jsTestLog(results);
      

            Assignee:
            rui.liu@mongodb.com Rui Liu
            Reporter:
            rui.liu@mongodb.com Rui Liu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: