Priority: Major - P3
Affects Version/s: 2.3
Fix Version/s: 2.4
Insert 3 documents:
Find works as expected:
Find and modify silently mishandles the sort argument:
Instead the user must do:
However this is bad because:
a) dicts aren't ordered in python (and ordered dict isn't available in older python versions)
b) the API is inconsistent w.r.t. the find() call:
sort (optional): a list of (key, direction) pairs specifying the sort order for this query. See sort() for details.
c) The error occurs silently.
The sort argument should be sanity checked, and should be consistent.
The alternative is silent bugs in code (for example a library mongoqueue has a bug because of this inadvertent behaviour):