Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-12652

[SERVER] Note addition of $sortKey metadata to projection of query by mongos

      Description

      When a sort is requested for a query in a sharded cluster, the mongos will add a "$sortKey: {$meta: 'sortKey'}" entry to the projection that gets passed to the sharded mongod processes. Testing on 4.1.4 indicates that this is true for SINGLE_SHARD plans as well. This impacts how index filters get applied and should be taken into consideration when configuring them.

       This should be added to the planCacheSetFilter page. We can also consider adding it to the mongos "sharded cluster query router" page since there's a sorting section, although it currently only mentions the behavior when no sort is requested.

      Scope of changes

      Impact to Other Docs

      MVP (Work and Date)

      Resources (Scope or Design Docs, Invision, etc.)

            Assignee:
            Unassigned Unassigned
            Reporter:
            christopher.harris@mongodb.com Chris Harris
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:
              49 weeks, 3 days ago