Collation and index sort compatibility
Parent: MongoDB Query Shape Optimization: Sort, Pagination, Operators and Sharded Targeting · Published reference · snapshot 2026-10-21 · skill ranked-a7641cd8
↓ Facts as markdownall context files
Source-anchored research for Collation and index sort compatibility. Run status: COMPLETED.
These notes link each claim to its source. Some citations identify archived research reports that are no longer hosted on this site. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.
How it works
- Collation-aware index keys may be larger than keys for indexes without collation because MongoDB uses ICU collation keys to establish string order. (high confidence) [source]
- A case-insensitive sort can apply a locale collation to the find operation and then sort by the string field. A case-insensitive index can support that order when the operation uses the same collation; strength 1 or 2 can configure a case-insensitive collation. (medium confidence) [source]
Comparisons and alternatives
- For string sort fields, an index whose collation differs from the operation's effective collation cannot provide the required indexed string order. Check the collection default and any operation override when explaining why MongoDB does not choose a collated index. (high confidence) [source]
- MongoDB Jira SERVER-136628 reports that, on a collated collection, pushing a string equality filter into a full index scan used only for sorting can drop matching documents. Its reproducer reports no results instead of two case variants when pushdown is enabled on a local 2026-09-17 build; the ticket was marked Unresolved / Needs Scheduling at its last update on 2026-10-08. (low confidence) (verified as of 2026-10-08) [source]
Facts and statements
- Matching collations do not remove compound-index sort constraints. Sort fields must appear in index order, their directions must match the index pattern or its full reverse, and a non-prefix sort needs equality predicates on all preceding index fields. Otherwise MongoDB may need a blocking sort. (high confidence) [source]
- A collation mismatch does not make every use of a compound index unavailable. If the index prefix keys are not strings, arrays, or embedded documents, MongoDB can still use the index for comparisons on that prefix. Its example uses an index on {score: 1, price: 1, category: 1} with French collation and a simple-collation query that filters score and sorts by price; string comparisons on category remain unsupported by that index. (high confidence) [source]
Children
- Compound-index prefix and sort-direction compatibility (frontier)
- Collation-aware index key size (frontier)
Frontier under this node: Collation-aware index key size, Compound-index prefix and sort-direction compatibility