---
name: "mongoc_cursor_set_batch_size"
section: "3"
platform: "linux"
package: "libmongoc-doc"
version: "1.30.4-1+deb13u3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mongoc_cursor_set_batch_size"
---

# mongoc\_cursor\_set\_batch\_size(3)

## SYNOPSIS

```
void
mongoc_cursor_set_batch_size (mongoc_cursor_t *cursor, uint32_t batch_size);
```

## PARAMETERS

- •

  **cursor**: A *mongoc\_cursor\_t*.

- •

  **batch\_size**: The requested number of documents per batch.

## DESCRIPTION

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 *Cursor Batches* in the MongoDB Manual.

This is not applicable to all cursors. Calling *mongoc\_cursor\_set\_batch\_size()* on a cursor returned by *mongoc\_client\_find\_databases\_with\_opts()*, *mongoc\_database\_find\_collections\_with\_opts()*, or *mongoc\_collection\_find\_indexes\_with\_opts()* will not change the results.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
