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:documentMUST 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β amongoc_bulk_operation_t. your whole bulk-operation situation, the container of the queue β¨selectorβ abson_tthat selects which documents to remove π (yes, that's what the docs say, bestie, i don't make the rules)documentβ abson_tcontaining the update document, aka the actual change you're bringing πupsertβtrueif 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 π«Ά
π COPYRIGHT π
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
- 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