---
name: "mongoc_cursor_set_max_await_time_ms"
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_max_await_time_ms"
---

# mongoc\_cursor\_set\_max\_await\_time\_ms(3)

## SYNOPSIS

```
void
mongoc_cursor_set_max_await_time_ms (mongoc_cursor_t *cursor,
                                     uint32_t max_await_time_ms);
```

## PARAMETERS

- •

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

- •

  **max\_await\_time\_ms**: A timeout in milliseconds.

## DESCRIPTION

The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query. Only applies if the cursor is created from *mongoc\_collection\_find\_with\_opts()* with "tailable" and "awaitData" options, and the server is MongoDB 3.2 or later. See *the documentation for maxTimeMS and the "getMore" command*.

The **max\_await\_time\_ms** cannot be changed after the first call to *mongoc\_cursor\_next()*.

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.

Note: although **max\_await\_time\_ms** is a uint32\_t, it is possible to set it as a uint64\_t through the options arguments in some cursor returning functions like *mongoc\_collection\_find\_with\_opts()*.

**SEE ALSO:**

```
Tailable Cursors.
```

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
