SBE $sort {_id:1} after $group disagrees with Classic for array-valued _id

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Execution
    • ALL
    • QE 2026-05-25, QE 2026-06-08, QE 2026-06-22, QE 2026-07-06
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Repro:

        db.t.drop();
        db.t.insertMany([{_id: 1, x: "a"}, {_id: 2, x: [-999]}]);
        db.t.aggregate([{$group: {_id: "$x"}}, {$sort: {_id: 1}}]).toArray();
        

      SBE (featureFlagSbeFull=true):

        [ { _id: [ -999 ] }, { _id: "a" } ]
        

      Classic:

        [ { _id: "a" }, { _id: [ -999 ] } ]

        1. sbe_issue.js
          3 kB
        2. repro.js
          1 kB

            Assignee:
            Kristina Znam
            Reporter:
            Projjal Chanda
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: