MONGOC_BULK_O...ON_REPLACE_ONE(3)
π MONGOC_BULK_O...ON_REPLACE_ONE(3) π
okay bestie, so this is a page straight out of libmongoc β yes, the MongoDB C driver β and it's about queueing up a single document replacement inside a bulk op. no cap, it's a small one, so let's get into it π«Ά
β¨ SYNOPSIS β¨
void
mongoc_bulk_operation_replace_one (mongoc_bulk_operation_t *bulk,
const bson_t *selector,
const bson_t *document,
bool upsert);
so like, what it does: it replaces a single document as part of a bulk operation. but here's the thing, and it's giving very important β this function only queues the operation. it does not run it. nope. nada. β
to actually make it happen, you gotta call mongoc_bulk_operation_execute(). that's the main character that does the real work π
also, heads up babe: this function is superseded by mongoc_bulk_operation_replace_one_with_opts(). so like, it's still here, but the newer one is the vibe now πΈ
π PARAMETERS π
bulkβ amongoc_bulk_operation_t. the bulk op container, the whole situation.selectorβ abson_tthat selects which document to remove. yes, that's what it says π that's your target-picker.documentβ abson_tcontaining the replacement document. the glow-up you're swapping in πupsertβtrueif this should be an upsert.
β οΈ WARNING:documentmay not contain fields with keys containing.or$. literally don't do it. the dots and dollars are not invited to this party π periodt.
π ERRORS π
errors are propagated via mongoc_bulk_operation_execute() β so don't come looking for them here, they get passed over to the execute call, iykyk.
SEE ALSO: mongoc_bulk_operation_replace_one_with_opts()
π AUTHOR π
MongoDB, Inc
π COPYRIGHT π
2009-present, MongoDB, Inc.
and that's the whole page, bestie β slay, you read it all π¦β¨
libmongoc, version 2.5.6 β dated Oct 09, 2026 π fr fr, see you in the next manpage ππ
π¦ 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