-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
[2020/08/06 20:17:46.730] WARNING: ********************************************************************** [2020/08/06 20:17:46.730] File "../motor/motor_asyncio.py", line ?, in sort [2020/08/06 20:17:46.730] Failed example: [2020/08/06 20:17:46.730] @gen.coroutine [2020/08/06 20:17:46.730] def f(): [2020/08/06 20:17:46.730] cursor = collection.find().sort('_id', pymongo.DESCENDING) [2020/08/06 20:17:46.730] docs = await cursor.to_list(None) [2020/08/06 20:17:46.730] print([d['_id'] for d in docs]) [2020/08/06 20:17:46.730] Exception raised: [2020/08/06 20:17:46.730] Traceback (most recent call last): [2020/08/06 20:17:46.730] File "/opt/python/3.6/lib/python3.6/doctest.py", line 1330, in __run [2020/08/06 20:17:46.730] compileflags, 1), test.globs) [2020/08/06 20:17:46.730] File "/data/mci/44553ece43d10434bbb82f6162f8c3b5/src/.tox/py3-sphinx-doctest/lib/python3.6/site-packages/sphinx/ext/doctest.py", line 476, in compile [2020/08/06 20:17:46.730] return compile(code, name, self.type, flags, dont_inherit) [2020/08/06 20:17:46.730] File "<doctest sort[0]>", line 4 [2020/08/06 20:17:46.730] docs = await cursor.to_list(None) [2020/08/06 20:17:46.730] ^ [2020/08/06 20:17:46.730] SyntaxError: invalid syntax [2020/08/06 20:17:47.459] WARNING: ********************************************************************** [2020/08/06 20:17:47.459] File "../motor/motor_asyncio.py", line ?, in sort_text [2020/08/06 20:17:47.459] Failed example: [2020/08/06 20:17:47.459] @gen.coroutine [2020/08/06 20:17:47.459] def f(): [2020/08/06 20:17:47.459] cursor = collection.find({ [2020/08/06 20:17:47.459] '$text': {'$search': 'some words'}}, [2020/08/06 20:17:47.459] {'score': {'$meta': 'textScore'}}) [2020/08/06 20:17:47.459] # Sort by 'score' field. [2020/08/06 20:17:47.459] cursor.sort([('score', {'$meta': 'textScore'})]) [2020/08/06 20:17:47.459] docs = await cursor.to_list(None) [2020/08/06 20:17:47.459] for doc in docs: [2020/08/06 20:17:47.459] print('%.1f %s' % (doc['score'], doc['field'])) [2020/08/06 20:17:47.459] Exception raised: [2020/08/06 20:17:47.459] Traceback (most recent call last): [2020/08/06 20:17:47.459] File "/opt/python/3.6/lib/python3.6/doctest.py", line 1330, in __run [2020/08/06 20:17:47.459] compileflags, 1), test.globs) [2020/08/06 20:17:47.459] File "/data/mci/44553ece43d10434bbb82f6162f8c3b5/src/.tox/py3-sphinx-doctest/lib/python3.6/site-packages/sphinx/ext/doctest.py", line 476, in compile [2020/08/06 20:17:47.459] return compile(code, name, self.type, flags, dont_inherit) [2020/08/06 20:17:47.459] File "<doctest sort_text[0]>", line 9 [2020/08/06 20:17:47.459] docs = await cursor.to_list(None) [2020/08/06 20:17:47.459] ^ [2020/08/06 20:17:47.459] SyntaxError: invalid syntax [2020/08/06 20:17:47.459] WARNING: ********************************************************************** [2020/08/06 20:17:47.459] File "../motor/motor_asyncio.py", line ?, in sort_text [2020/08/06 20:17:47.459] Failed example: [2020/08/06 20:17:47.459] IOLoop.current().run_sync(f) [2020/08/06 20:17:47.459] Exception raised: [2020/08/06 20:17:47.459] Traceback (most recent call last): [2020/08/06 20:17:47.459] File "/opt/python/3.6/lib/python3.6/doctest.py", line 1330, in __run [2020/08/06 20:17:47.459] compileflags, 1), test.globs) [2020/08/06 20:17:47.459] File "<doctest sort_text[1]>", line 1, in <module> [2020/08/06 20:17:47.459] IOLoop.current().run_sync(f) [2020/08/06 20:17:47.459] NameError: name 'f' is not defined
- related to
-
MOTOR-420 Update documentation to remove legacy patterns
- Closed