{$meta: "sortKey"} validation is inconsistent

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Integration
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      A query like

       

      [{$project: {a: {$meta: "sortKey"}}}]

      fails with the error "cannot use sortKey $meta projection without a sort", but this query succeeds:

       

       

      [{$group: {_id: "$a", vals: {$addToSet: {$meta: "sortKey"}}}}] 

       

      This validation is inconsistent with the other meta fields. It may be because this validation takes place here within canonical_query.cpp, rather than as part of the DepsTracker, like is used for the other meta fields.

              Assignee:
              Unassigned
              Reporter:
              Will Buerger
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: