MONGOC_COLLEC...BULK_OPERATION(3)

πŸŽ€ MONGOC_COLLEC...BULK_OPERATION(3) πŸŽ€

okay bestie, come sit with me, we're reading a libmongoc page together and honestly? it's giving vintage. πŸ’…

⚠️ WARNING: Deprecated since version 1.9.0. Use mongoc_collection_create_bulk_operation_with_opts() instead. fr fr, this one's the old model, the new one ate. 😭

✨ SYNOPSIS ✨

mongoc_bulk_operation_t *
mongoc_collection_create_bulk_operation (
   mongoc_collection_t *collection,
   bool ordered,
   const mongoc_write_concern_t *write_concern);

🌸 PARAMETERS 🌸

  • collection: a mongoc_collection_t. literally the collection you're doing the thing on 🫢
  • ordered: whether the operations must be performed in order. the vibe check on sequencing ⭐
  • write_concern: an optional mongoc_write_concern_t, or NULL. optional bestie, no pressure πŸ’–

πŸ¦‹ DESCRIPTION πŸ¦‹

So this function shall begin a new bulk operation. "Shall" β€” yes, it's that serious. πŸ‘‘

Once you've created it, you may call a whole lil friend group of functions on it, like mongoc_bulk_operation_update(), mongoc_bulk_operation_insert(), and others. the squad is assembled. 🌈

After you call mongoc_bulk_operation_execute(), the commands will be executed in as large as batches as reasonable by the client. the client is out here doing its best to batch them big, and we respect the hustle. ✨

  • If ordered is true, then processing will stop at the first error. one strike and it's over, periodt. πŸ’€
  • If ordered is not true, then the bulk operation will attempt to continue processing even after the first failure. she gets back up, she keeps going, main character energy. πŸ¦‹

write_concern contains the write concern for all operations in the bulk operation. If it's NULL, the collection's write concern is used. And the global default? Acknowledged writes: MONGOC_WRITE_CONCERN_W_DEFAULT. that's the factory setting, the default outfit, iykyk. πŸ’…


πŸ™ˆ ERRORS πŸ™ˆ

Errors are propagated when executing the bulk operation. so they don't show up at creation time, they pop out later when you execute β€” keep an eye out, bestie. 😭


πŸ‘‘ RETURNS πŸ‘‘

A newly allocated mongoc_bulk_operation_t that should be freed with mongoc_bulk_operation_destroy() when no longer in use. you gotta clean up after yourself, that's just basic roommate etiquette. 🧚

⚠️ WARNING: Failure to handle the result of this function is a programming error. not me forgetting to handle the return value... girl. don't be that girl. πŸ’€

SEE ALSO:

  • Bulk Write Operations
  • mongoc_bulk_operation_t

πŸ’œ AUTHOR πŸ’œ

MongoDB, Inc

2009-present, MongoDB, Inc.


and that's the whole page, bestie, no skips, no skims, we read every single line like the icons we are. πŸ’–

this lil time capsule is from libmongoc version 1.30.13, dated Oct 09, 2026 β€” so screenshot it, because that's the cutest part of the whole thing. βœ¨πŸŽ€

πŸ“¦ where this page comes from