MONGOC_COLLECTION_WATCH(3) | MongoDB C Driver | MONGOC_COLLECTION_WATCH(3) |
mongoc_collection_watch - mongoc_collection_watch()
mongoc_change_stream_t* mongoc_collection_watch (const mongoc_collection_t *coll,
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 collection. 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:
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_client_watch
mongoc_database_watch
MongoDB, Inc
2017-present, MongoDB, Inc
February 23, 2019 | 1.14.0 |