Details
-
Bug
-
Resolution: Done
-
Minor - P4
-
None
-
None
-
None
-
*Location*: https://docs.mongodb.com/manual/core/index-compound/
*User-Agent*: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0
*Referrer*: https://docs.mongodb.com/manual/core/index-single/
*Screen Resolution*: 1920 x 1080
-
0.25
Description
Submitter's Comment
The rule of sort order about compound indexes on this page is opposit with https://docs.mongodb.com/manual/tutorial/sort-results-with-indexes/. Latter one says "The sort must specify the same sort direction (i.e.ascending/descending) for all its keys as the index key pattern or specify the reverse sort direction for all its keys as the index key pattern".
Grooming Description
Use Indexes to Sort Query Results states the following:
The sort must specify the same sort direction (i.e.ascending/descending) for all its keys as the index key pattern
If one is reading quickly, it's easy to miss the as the index key pattern and conclude that when sorting, compound indexes support only {a:1, b:1} indexes, but not {a:1, b:-1} ("the sort must specify the same sort direction for all its keys"). We should rephrase this to better explain what we're actually trying to explain.
I've taken a stab at doing so my below reply to the original submitter.