-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Labels:None
Link to text
http://docs.mongodb.org/manual/reference/command/distinct/
The following text should include additional clarification so that the users are aware of how it works starting from version 2.6
When possible, the distinct command uses an index to find documents and return values.
Please replace it with something like the following in order to reflect how an index may be chosen chosen.
When convenient to use covered indexes, the db.collection.distinct() method will use an index to find the documents in the query as well as to return the results. A covered will only be used when the index is prefixed by the field in the distinct method. Although there are some cases where a compound index with the distinct field not in the prefix may be a suitable a covered index query, MongoDB cannot reliably determine suitability, so will instead use the underlying documents. In earlier versions, MongoDB would attempt to use any index containing the distinct field.