MongoDB.CursorSetBatchSize
--------------------------

Sets batch size,

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [MongoDB](component_MongoDB.md) | [12.3](newinversion123.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "MongoDB.CursorSetBatchSize"; MongoDBRef; Size ) 

**MBS**( **"MongoDB.CursorSetBatchSize";** /\* Sets batch size, \*/  
**$MongoDBRef**; /\* The reference number for the mongo connection.e.g. $MongoDB \*/   
**$Size**) /\* The new batch size.e.g. 100 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| MongoDBRef | The reference number for the mongo connection. | $MongoDB |
| Size | The new batch size. | 100 |

### Result

Returns OK or error.

### Description

Sets batch size,  
Limits the number of documents returned in one batch. Each batch requires a round trip to the server. If the batch size is zero, the cursor uses the server-defined maximum batch size.  
### See also

- [MongoDB.CursorBatchSize](MongoDBCursorBatchSize.md)

This function checks for a license.

Created 22nd May 2022 , last changed 22nd May 2022

  
[MongoDB.CursorRecords](MongoDBCursorRecords.md) - [MongoDB.CursorSetLimit](MongoDBCursorSetLimit.md)

[HTML Version](MongoDBCursorSetBatchSize.shtml)