---
name: "mongoc_change_stream_get_resume_token"
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_change_stream_get_resume_token"
---

# mongoc\_change\_stream\_get\_resume\_token(3)

## SYNOPSIS

```
const bson_t *
mongoc_change_stream_get_resume_token (mongoc_change_stream_t *stream);
```

This function returns the cached resume token, which may be passed as either the **resumeAfter** or **startAfter** option of a **watch** function to start a new change stream from the same point.

## PARAMETERS

- •

  **stream**: A *mongoc\_change\_stream\_t*.

## RETURNS

A *bson\_t* that should not be modified or freed.

Returns **NULL** if no resume token is available. This is possible if the change stream has not been iterated and neither **resumeAfter** nor **startAfter** options were specified in the **watch** function.

## LIFECYCLE

The returned *bson\_t* is valid for the lifetime of **stream** and its data may be updated if *mongoc\_change\_stream\_next()* is called after this function. The value may be copied to extend its lifetime or preserve the current resume token.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
