[DOCS-7574] Comment on: "manual/tutorial/sort-results-with-indexes.txt" Created: 05/Apr/16  Updated: 30/Oct/23

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Bug Priority: Major - P3
Reporter: Docs Collector User (Inactive) Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: collector-298ba4e7, docs-triage
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

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


Participants:
Days since reply: 1 year, 14 weeks, 2 days ago
Epic Link: DOCSP-1769

 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

{ c: 1 }

, 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(

{ c: 5 }

).sort(

{ c: 1 }

)
These operations will not efficiently use the index

{ a: 1, b: 1, c: 1, d: 1 }

and may not even use the index to retrieve the documents.
---------------------
In my testing actually "find( { a:

{ $gt: 2 }

} ).sort(

{ c: 1 }

)" example uses index! But the description says it will not use index.
Please check that out, and confirm it.



 Comments   
Comment by Education Bot [ 31/Oct/22 ]

Hello! This ticket has been closed due to inactivity. If you believe this ticket is still important, please reopen it and leave a comment to explain why. Thank you!

Generated at Thu Feb 08 07:54:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.