Details
-
Improvement
-
Resolution: Done
-
Major - P3
-
None
-
None
-
None
Description
Breaking change. Implementing this API for Motor was a mistake:
@gen.coroutine
|
def fifth_item():
|
yield collection.insert([{'i': i} for i in range(10)])
|
cursor = collection.find().sort([('i', 1)])[5]
|
yield cursor.fetch_next
|
doc = cursor.next_object()
|
Require users to set skip and limit longhand:
@gen.coroutine
|
def fifth_item():
|
yield collection.insert([{'i': i} for i in range(10)])
|
cursor = collection.find().sort([('i', 1)]).skip(5).limit(1)
|
yield cursor.fetch_next
|
doc = cursor.next_object()
|
print(doc['i'])
|
|
IOLoop.current().run_sync(fifth_item)
|
Attachments
Issue Links
- is depended on by
-
MOTOR-64 Incorrect iteration of MotorCursor causes infinite loop
-
- Closed
-