MONGOC_CHANGE_STREAM_NEXT(3)
π MONGOC_CHANGE_STREAM_NEXT(3) π
okay bestie, you're looking at the MONGOC_CHANGE_STREAM_NEXT(3) page from the libmongoc manual, and this one is short but lowkey important. β¨
β¨ SYNOPSIS β¨
bool
mongoc_change_stream_next (mongoc_change_stream_t *stream,
const bson_t **bson);
So what does it do? It iterates the underlying cursor, setting bson to the next document. π«Ά This will block for a maximum of maxAwaitTimeMS milliseconds as specified in the options when created, or the default timeout if omitted. Data may be returned before the timeout. If no data is returned this function returns false. π
π PARAMETERS π
stream: Amongoc_change_stream_t. The main character.bson: The location for the resulting document. That's where the next doc goes, bestie. π
π RETURNS π
This function returns true if a valid bson document was read from the stream. Otherwise, false if there was an error or no document was available. π
Errors can be determined with the mongoc_change_stream_error_document() function. π₯
π¦ LIFECYCLE π¦
Similar to mongoc_cursor_next() the lifetime of bson is until the next call to mongoc_change_stream_next(), so it needs to be copied to extend the lifetime. β οΈ That's the rule, no cap.
π AUTHOR π
MongoDB, Inc
π COPYRIGHT π
2009-present, MongoDB, Inc.
π cute sign-off: this iconic manual page comes fromlibmongocversion2.5.6, datedOct 09, 2026β and yes, the page name isMONGOC_CHANGE_STREAM_NEXT(3), periodt. π
π¦ where this page comes from
- epel 10: mongo-c-driver-devel 2.5.6-1.el10_3 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms