Details
-
Bug
-
Resolution: Won't Do
-
Major - P3
-
None
-
tested under mongos v3.0.7 windows 64bit version & Sharding environment
*Location*: https://docs.mongodb.org/manual/tutorial/sort-results-with-indexes/
*User-Agent*: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36
*Referrer*: https://docs.mongodb.org/v3.0/tutorial/sort-results-with-indexes/
*Screen Resolution*: 1366 x 768
*repo*: docs
*source*: tutorial/sort-results-with-indexes
tested under mongos v3.0.7 windows 64bit version & Sharding environment *Location*: https://docs.mongodb.org/manual/tutorial/sort-results-with-indexes/ *User-Agent*: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36 *Referrer*: https://docs.mongodb.org/v3.0/tutorial/sort-results-with-indexes/ *Screen Resolution*: 1366 x 768 *repo*: docs *source*: tutorial/sort-results-with-indexes
Description
In the document: https://docs.mongodb.or/manual/tutorial/sort-results-with-indexes/ (for version 3.2 and 3.0 both)
The last example and description has a problem:
---------------
....For example, the following operations specify a sort document of
, but the query documents do not contain equality matches on the preceding index fields a and b:
db.data.find( { a:
{ $gt: 2 }} ).sort(
{ c: 1 } )
db.data.find(
).sort(
{ c: 1 } )
These operations will not efficiently use the index
and may not even use the index to retrieve the documents.
---------------------
In my testing actually "find( { a:
} ).sort(
{ c: 1 } )" example uses index! But the description says it will not use index.
Please check that out, and confirm it.