On this page
cursor.batchSize()
在本页面
Definition
cursor.
batchSize
(* size *)
batchSize()方法采用以下参数:
Parameter | Type | Description |
---|---|---|
size |
integer | 每批退回的文档数。 不要 使用1 的批处理大小。 |
Note
指定1
或负数类似于使用limit()方法。
Example
以下示例将查询结果(即find())的批处理大小设置为10
。 batchSize()方法不会更改mongo shell 中的输出,该 shell 默认情况下会迭代前 20 个文档。
db.inventory.find().batchSize(10)