Skip to content

Commit a220c23

Browse files
committed
Update batch_size docstring PYTHON-350
1 parent 3695ddb commit a220c23

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pymongo/cursor.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,14 @@ def limit(self, limit):
307307
return self
308308

309309
def batch_size(self, batch_size):
310-
"""Set the size for batches of results returned by this cursor.
310+
"""Limits the number of documents returned in one batch. Each batch
311+
requires a round trip to the server. It can be adjusted to optimize
312+
performance and limit data transfer.
313+
314+
.. note:: batch_size can not override MongoDB's internal limits on the
315+
amount of data it will return to the client in a single batch (i.e
316+
if you set batch size to 1,000,000,000, MongoDB will currently only
317+
return 4-16MB of results per batch).
311318
312319
Raises :class:`TypeError` if `batch_size` is not an instance
313320
of :class:`int`. Raises :class:`ValueError` if `batch_size` is

0 commit comments

Comments
 (0)