-
Type: New Feature
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
Add "length" option to Cursor.to_list for motor compat. See https://motor.readthedocs.io/en/latest/api-asyncio/cursors.html#motor.motor_asyncio.AsyncIOMotorCursor.to_list
Motor's length option is required while I believe pymongo's should be optional, defaulting to None. This yields a more natural api since passing length=None is awkward:
# returns all docs await cursor.to_list() # returns all docs await cursor.to_list(length=None) # returns at most 5 docs await cursor.to_list(length=5)
.