MONGOC_CHANGE...ERROR_DOCUMENT(3)

πŸ¦‹ MONGOC_CHANGE...ERROR_DOCUMENT(3) πŸ¦‹

okay bestie so this one lives in the libmongoc house πŸ’– and it's the little function that goes "hey... did something go wrong in there?" for your change streams. no cap, it's lowkey the vibe check of the change-stream world πŸ‘‘


✨ SYNOPSIS ✨

bool
mongoc_change_stream_error_document (mongoc_change_stream_t *stream,
                                     bson_error_t *err,
                                     const bson_t **reply);

🌸 DESCRIPTION 🌸

So the way this works is: it checks if an error has occurred when creating or iterating over a change stream. That's the whole job, and it eats every time πŸ’…

It's similar to mongoc_cursor_error_document() β€” like, the same energy, different function, iykyk.

Here's the tea on how reply gets set 🍡:

  • If the error has occurred client-side, then reply will be set to an empty BSON document. Literally nothing in there. an empty little guy 🫢
  • If the error occurred server-side, reply is set to the server's reply document. so you actually get the receipts πŸ”₯

πŸŽ€ PARAMETERS πŸŽ€

  • stream β€” A mongoc_change_stream_t. your change stream bestie, the main character ✨
  • err β€” An optional location for a bson_error_t, or NULL. it's optional fr fr, you can absolutely pass NULL here if you're built different πŸ™ˆ
  • reply β€” A location for a bson_t. this is where the reply document gets dropped off πŸ’Œ

⭐ RETURNS ⭐

A boolean indicating if there was an error.

like, true = something went sideways 😭, false = we're so back 🌈. simple as that, periodt.


πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc


2009-present, MongoDB, Inc.


okay that's the whole page, you ate that πŸ“ version 2.5.6, dated Oct 09, 2026 β€” go forth and error-check your change streams, icon πŸ’…πŸ§šπŸ’–

πŸ“¦ where this page comes from