MONGOC_BULK_OPERATION_UPDATE(3)

✨ MONGOC_BULK_OPERATION_UPDATE πŸ’…

okay bestie, gather round, because this one lives in libmongoc and it's like... a little vintage, but we still need to know her πŸŽ€


🌸 SYNOPSIS 🌸

void
mongoc_bulk_operation_update (mongoc_bulk_operation_t *bulk,
                              const bson_t *selector,
                              const bson_t *document,
                              bool upsert);

πŸ¦‹ DESCRIPTION πŸ¦‹

so what does she do?? literally just queues an update as part of a bulk operation. that's it. that's the whole vibe. she does NOT execute anything β€” she's the planner, not the performer πŸ’… the actual main-character moment happens when you call mongoc_bulk_operation_execute() to run the entire bulk operation. periodt.

🚨 important, no cap: document MUST only contain fields whose key starts with $. like, that's the rule. see the update document specification for more details if you need the full lore iykyk.

and ngl, this function is superseded β€” she's been gently replaced by mongoc_bulk_operation_update_one_with_opts() and mongoc_bulk_operation_update_many_with_opts(). she's still iconic, but the new girls are running the show 🫢


πŸŽ€ PARAMETERS πŸŽ€

  • bulk β€” a mongoc_bulk_operation_t. your whole bulk-operation situation, the container of the queue ✨
  • selector β€” a bson_t that selects which documents to remove πŸ‘€ (yes, that's what the docs say, bestie, i don't make the rules)
  • document β€” a bson_t containing the update document, aka the actual change you're bringing 🌈
  • upsert β€” true if an upsert should be performed. flip that flag if you want upsert energy πŸ’–

πŸ’€ ERRORS πŸ’€

errors don't get thrown from here at all β€” they're propagated via mongoc_bulk_operation_execute() 😭 so if something goes sideways, that's where you go looking. not here. not today.

πŸ‘€ SEE ALSO πŸ‘€

  • mongoc_bulk_operation_update_one_with_opts() 🧚
  • mongoc_bulk_operation_update_many_with_opts() 🧚

πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc β€” the icons themselves 🫢

2009-present, MongoDB, Inc. β€” like, they've been doing this since 2009 and honestly? slay.


okay that's the whole page, you ate it up, no crumbs left πŸ“ signed off with love from the libmongoc girlies β€” 2.5.6, dated Oct 09, 2026, and yes the manual name is MONGOC_BULK_OPERATION_UPDATE(3) in case anyone asks at the function πŸ’…βœ¨

πŸ“¦ where this page comes from