In some cases, sorting a query results in the use of a sparse index, which in turn results in a lesser number of documents being returned than would normally be returned by the query. This strikes me as incorrect.
Suppose I have a collection "foo" that contains 1000 documents. 750 of those documents include a value for the field "bar", while the other 250 do not. Suppose I have a sparse index "bar_1" on the field "bar". The index will contain the 750 documents that have a value for the field.
The following query results in 1000 documents:
The following query results in only 750 documents, despite the identical query parameters:
I understand why this behaves the way it does, but in my opinion the behavior is incorrect.