-
Type: New Feature
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
-
None
>>> client.t.t.find(hint={'x': 1}) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/shane/git/mongo-python-driver/pymongo/collection.py", line 1381, in find return Cursor(self, *args, **kwargs) File "/Users/shane/git/mongo-python-driver/pymongo/cursor.py", line 220, in __init__ self.__set_hint(hint) File "/Users/shane/git/mongo-python-driver/pymongo/cursor.py", line 860, in __set_hint self.__hint = helpers._index_document(index) File "/Users/shane/git/mongo-python-driver/pymongo/helpers.py", line 86, in _index_document raise TypeError("passing a dict to sort/create_index/hint is not " TypeError: passing a dict to sort/create_index/hint is not allowed - use a list of tuples instead. did you mean [('x', 1)]?
Now that we've dropped support for Python <=3.5 (PYTHON-2386) we should allow passing dict to sort/create_index/hint. Dicts are always ordered by insertion order in 3.6+.
- depends on
-
PYTHON-2386 Drop Python 3.5 support
- Released
- is related to
-
PYTHON-2884 Use dict instead of SON for internal command construction
- Closed