-
Type: Task
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: manual
-
Labels:
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.
- depends on
-
SERVER-16270 Set query filtering with mongoS/ per replica set
- Backlog
- duplicates
-
DOCS-12652 [SERVER] Note addition of $sortKey metadata to projection of query by mongos
- Closed
- is related to
-
SERVER-13008 Encoding of projection for query plan cache should be type-insensitive
- Closed