File: mongoc_change_stream_get_resume_token.rst

package info (click to toggle)
mongo-c-driver 1.17.6-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 37,256 kB
  • sloc: ansic: 152,613; javascript: 7,954; python: 3,259; sh: 138; makefile: 29; xml: 10
file content (38 lines) | stat: -rw-r--r-- 1,099 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
:man_page: mongoc_change_stream_get_resume_token

mongoc_change_stream_get_resume_token()
=======================================

Synopsis
--------

.. code-block:: c

  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 :symbol:`mongoc_change_stream_t`.

Returns
-------

A :symbol:`bson: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 :symbol:`bson:bson_t` is valid for the lifetime of ``stream`` and
its data may be updated if :symbol:`mongoc_change_stream_next` is called after
this function. The value may be copied to extend its lifetime or preserve the
current resume token.