mongoc_client_watch
mongoc_client_watch()
- Provided by: libmongoc-doc (Version: 1.16.1-1build2)
- Source: mongo-c-driver
- Report a bug
mongoc_client_watch()
mongoc_change_stream_t*
mongoc_client_watch (mongoc_client_t *client,
const bson_t *pipeline,
const bson_t *opts);
A helper function to create a change stream. It is preferred to call this function over using a raw aggregation to create a change stream.
This function uses the read preference and read concern of the client. If the change stream needs to re-establish connection, the same read preference will be used. This may happen if the change stream encounters a resumable error.
WARNING:
This function is considered a retryable read operation. Upon a transient error (a network error, errors due to replica set failover, etc.) the operation is safely retried once. If retryreads is false in the URI (see mongoc_uri_t) the retry behavior does not apply.
opts may be NULL or a BSON document with additional command options:
A newly allocated mongoc_change_stream_t which must be freed with mongoc_change_stream_destroy when no longer in use. The returned mongoc_change_stream_t is never NULL. If there is an error, it can be retrieved with mongoc_change_stream_error_document, and subsequent calls to mongoc_change_stream_next will return false.
mongoc_database_watch
mongoc_collection_watch
MongoDB, Inc
2017-present, MongoDB, Inc