Skip to content

Commit c0c7c05

Browse files
committed
PYTHON-1762 Document that limit=0 means no limit
1 parent bb83a26 commit c0c7c05

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pymongo/collection.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,7 +1300,8 @@ def find(self, *args, **kwargs):
13001300
- `skip` (optional): the number of documents to omit (from
13011301
the start of the result set) when returning the results
13021302
- `limit` (optional): the maximum number of results to
1303-
return
1303+
return. A limit of 0 (the default) is equivalent to setting no
1304+
limit.
13041305
- `no_cursor_timeout` (optional): if False (the default), any
13051306
returned cursor is closed by the server after 10 minutes of
13061307
inactivity. If set to True, the returned cursor will never
@@ -1624,7 +1625,8 @@ def count_documents(self, filter, session=None, **kwargs):
16241625
16251626
- `skip` (int): The number of matching documents to skip before
16261627
returning results.
1627-
- `limit` (int): The maximum number of documents to count.
1628+
- `limit` (int): The maximum number of documents to count. Must be
1629+
a positive integer. If not provided, no limit is imposed.
16281630
- `maxTimeMS` (int): The maximum amount of time to allow this
16291631
operation to run, in milliseconds.
16301632
- `collation` (optional): An instance of
@@ -1700,7 +1702,8 @@ def count(self, filter=None, session=None, **kwargs):
17001702
17011703
- `skip` (int): The number of matching documents to skip before
17021704
returning results.
1703-
- `limit` (int): The maximum number of documents to count.
1705+
- `limit` (int): The maximum number of documents to count. A limit
1706+
of 0 (the default) is equivalent to setting no limit.
17041707
- `maxTimeMS` (int): The maximum amount of time to allow the count
17051708
command to run, in milliseconds.
17061709
- `collation` (optional): An instance of

0 commit comments

Comments
 (0)