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

Queries executed via MongoS will always project the sort key

      This is a "gotcha" when using index filters and evaluating query performance.

      When you issue a query via a MongoS that includes both a Projection and a Sort field, the sort field will always be included within the projection set to the shards. This is needed for sorting on the result data from shards by desired field on the MongoS.

      This means when you are adding index filters using projections, you should always expect to add the sort field to the projection in sharded environments.

            Assignee:
            andrew.aldridge@mongodb.com Andrew Aldridge
            Reporter:
            david.hows David Hows
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:
              8 years, 8 weeks, 3 days ago