MONGOC_COLLECTION_WATCH - Online Linux Manual PageSection : 3
Updated : Feb 04, 2021
Source : 1.17.4
Note : libmongoc
NAMEmongoc_collection_watch − mongoc_collection_watch()
SYNOPSIS 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: A change stream is only supported with majority read concern. 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.
PARAMETERS • coll: A mongoc_collection_t specifying the collection which the change stream listens to. • pipeline: A bson_t representing an aggregation pipeline appended to the change stream. This may be an empty document. • opts: A bson_t containing change stream options. opts may be NULL or a BSON document with additional command options: • batchSize: An int32 representing number of documents requested to be returned on each call to mongoc_change_stream_next • resumeAfter: A Document representing the logical starting point of the change stream. The result of mongoc_change_stream_get_resume_token() or the _id field of any change received from a change stream can be used here. This option is mutually exclusive with startAfter and startAtOperationTime. • startAfter: A Document representing the logical starting point of the change stream. Unlike resumeAfter, this can resume notifications after an "invalidate" event. The result of mongoc_change_stream_get_resume_token() or the _id field of any change received from a change stream can be used here. This option is mutually exclusive with resumeAfter and startAtOperationTime. • startAtOperationTime: A Timestamp. The change stream only provides changes that occurred at or after the specified timestamp. Any command run against the server will return an operation time that can be used here. This option is mutually exclusive with resumeAfter and startAfter. • maxAwaitTimeMS: An int64 representing the maximum amount of time a call to mongoc_change_stream_next will block waiting for data • fullDocument: A UTF−8 string. Set this option to "updateLookup" to direct the change stream cursor to lookup the most current majority−committed version of the document associated to an update change stream event.
RETURNSA 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.
SEE ALSOmongoc_client_watch mongoc_database_watch
AUTHORMongoDB, Inc
COPYRIGHT2017-present, MongoDB, Inc 0
Johanes Gumabo
Data Size : 13,122 byte
man-mongoc_collection_watch.3Build : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 2 / 238,001
Visitor ID : :
Visitor IP : 18.225.72.181 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.