From c0c7c0565260ff503db9c41f01a18bee22d7a763 Mon Sep 17 00:00:00 2001 From: Bernie Hackett Date: Mon, 18 Mar 2019 17:45:31 -0700 Subject: [PATCH] PYTHON-1762 Document that limit=0 means no limit --- pymongo/collection.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pymongo/collection.py b/pymongo/collection.py index 35100f1f7..0cfce8081 100644 --- a/pymongo/collection.py +++ b/pymongo/collection.py @@ -1300,7 +1300,8 @@ class Collection(common.BaseObject): - `skip` (optional): the number of documents to omit (from the start of the result set) when returning the results - `limit` (optional): the maximum number of results to - return + return. A limit of 0 (the default) is equivalent to setting no + limit. - `no_cursor_timeout` (optional): if False (the default), any returned cursor is closed by the server after 10 minutes of inactivity. If set to True, the returned cursor will never @@ -1624,7 +1625,8 @@ class Collection(common.BaseObject): - `skip` (int): The number of matching documents to skip before returning results. - - `limit` (int): The maximum number of documents to count. + - `limit` (int): The maximum number of documents to count. Must be + a positive integer. If not provided, no limit is imposed. - `maxTimeMS` (int): The maximum amount of time to allow this operation to run, in milliseconds. - `collation` (optional): An instance of @@ -1700,7 +1702,8 @@ class Collection(common.BaseObject): - `skip` (int): The number of matching documents to skip before returning results. - - `limit` (int): The maximum number of documents to count. + - `limit` (int): The maximum number of documents to count. A limit + of 0 (the default) is equivalent to setting no limit. - `maxTimeMS` (int): The maximum amount of time to allow the count command to run, in milliseconds. - `collation` (optional): An instance of