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

{$meta: "sortKey"} validation is inconsistent

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

      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 Unassigned
            Reporter:
            will.buerger@mongodb.com Will Buerger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: