On this page本页内容
cursor.
batchSize
(size)¶mongo
Shell Method
This page documents the 本页记录了mongo
shell method, and does not refer to the MongoDB Node.js driver (or any other driver) method. mongo
shell方法,未提及MongoDB Node.js驱动程序(或任何其他驱动程序)方法。For corresponding MongoDB driver API, refer to your specific MongoDB driver documentation instead.有关相应的MongoDB驱动程序API,请参阅特定的MongoDB驱动程序文档。
Specifies the number of documents to return in each batch of the response from the MongoDB instance. 指定MongoDB实例每批响应中要返回的文档数。In most cases, modifying the batch size will not affect the user or the application, as the 在大多数情况下,修改批大小不会影响用户或应用程序,因为mongo
shell and most drivers return results as if MongoDB returned a single batch.mongo
shell和大多数驱动程序返回的结果就像MongoDB返回单个批一样。
The batchSize()
method takes the following parameter:batchSize()
方法采用以下参数:
size |
integer | 1 .1 的批量大小。 |
The following example sets the batch size for the results of a query (i.e. 以下示例将查询结果(即find()
) to 10
. find()
)的批量大小设置为10
。The batchSize()
method does not change the output in the mongo
shell, which, by default, iterates over the first 20 documents.batchSize()
方法不会更改mongo
shell中的输出,默认情况下,mongo
shell会迭代前20个文档。