.\" Man page generated from reStructuredText. . .TH "MONGOC_CLIENT_WATCH" "3" "Feb 23, 2019" "1.14.0" "MongoDB C Driver" .SH NAME mongoc_client_watch \- mongoc_client_watch() . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C mongoc_change_stream_t* mongoc_client_watch (mongoc_client_t *client, const bson_t *pipeline, const bson_t *opts); .ft P .fi .UNINDENT .UNINDENT .sp 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. .sp 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. .sp \fBWARNING:\fP .INDENT 0.0 .INDENT 3.5 A change stream is only supported with majority read concern. .UNINDENT .UNINDENT .SH PARAMETERS .INDENT 0.0 .IP \(bu 2 \fBdb\fP: A \fBmongoc_client_t\fP specifying the client which the change stream listens to. .IP \(bu 2 \fBpipeline\fP: A \fI\%bson_t\fP representing an aggregation pipeline appended to the change stream. This may be an empty document. .IP \(bu 2 \fBopts\fP: A \fI\%bson_t\fP containing change stream options. .UNINDENT .sp \fBopts\fP may be NULL or a BSON document with additional command options: .INDENT 0.0 .IP \(bu 2 \fBbatchSize\fP: An \fBint32\fP representing number of documents requested to be returned on each call to \fBmongoc_change_stream_next\fP .IP \(bu 2 \fBresumeAfter\fP: A \fBDocument\fP representing the logical starting point of the change stream. The \fB_id\fP field of any change received from a change stream can be used here .IP \(bu 2 \fBstartAtOperationTime\fP: A \fBTimestamp\fP\&. 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. .IP \(bu 2 \fBmaxAwaitTimeMS\fP: An \fBint64\fP representing the maximum amount of time a call to \fBmongoc_change_stream_next\fP will block waiting for data .IP \(bu 2 \fBfullDocument\fP: 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. .UNINDENT .SH RETURNS .sp A newly allocated \fBmongoc_change_stream_t\fP which must be freed with \fBmongoc_change_stream_destroy\fP when no longer in use. The returned \fBmongoc_change_stream_t\fP is never \fBNULL\fP\&. If there is an error, it can be retrieved with \fBmongoc_change_stream_error_document\fP, and subsequent calls to \fBmongoc_change_stream_next\fP will return \fBfalse\fP\&. .SH SEE ALSO .sp mongoc_database_watch .sp mongoc_collection_watch .SH AUTHOR MongoDB, Inc .SH COPYRIGHT 2017-present, MongoDB, Inc .\" Generated by docutils manpage writer. .