MONGOC_BULK_O..._ONE_WITH_OPTS(3)
π MONGOC_BULK_O..._ONE_WITH_OPTS(3) π
okay so this is a page from libmongoc (section 3, manual-page girlies rise) and it's all about mongoc_bulk_operation_replace_one_with_opts β yes the name is long, yes she ate, no we are not abbreviating her π
β¨ SYNOPSIS β¨
bool
mongoc_bulk_operation_replace_one_with_opts (mongoc_bulk_operation_t *bulk,
const bson_t *selector,
const bson_t *document,
const bson_t *opts,
bson_error_t *error); /* OUT */
πΈ DESCRIPTION πΈ
Replace a single document as part of a bulk operation. Only queues the operation, bestie β that's the whole vibe. Nothing happens yet!! To actually execute it, you call mongoc_bulk_operation_execute(). Queue first, slay later. π
π¦ PARAMETERS π¦
bulkβ amongoc_bulk_operation_t. the main character, obviously πselectorβ abson_tthat selects which document to remove. (yes, that's what it says, no I'm not changing it, the original said remove and so do I π)documentβ abson_tcontaining the replacement document. the glow-up in question πerrorβ abson_error_tfor any errors that may have occurred. the receipts holder π
π opts β the optional little extras π
opts may be NULL, or a BSON document with additional command options:
validateβ construct a bitwise-or of all desiredbson_validate_flags_t. Set tofalseto skip client-side validation of the provided BSON documents. no vibe check on your BSON, live your truth β¨collationβ configure textual comparisons. See Setting Collation Order, and the MongoDB Manual entry on Collation. Collation requires MongoDB 3.2 or later, otherwise an error is returned. periodt β old servers get an error, not a pass π«Άhintβ a document or string that specifies the index to use to support the query predicate. a lil nudge-nudge-wink-wink to the query planner πupsertβ iftrue, insert a document if none matchselector. nobody matched? then she makes one. main character energy fr fr π₯sortβ specify a sort order when matching documents. because order matters, always π¦
β οΈ WARNING:documentmay not contain fields with keys containing.or$. like literally do not. π
π ERRORS π
Operation errors are propagated via mongoc_bulk_operation_execute(), while argument validation errors are reported by the error argument. so like... two different pipelines for your problems, iykyk π
β RETURNS β
Returns true on success, and false if passed invalid arguments. simple. iconic. no notes π
π SEE ALSO π
mongoc_bulk_operation_remove_many_with_opts()mongoc_bulk_operation_insert()
go read those too, bestie, they're literally right there π§
π AUTHOR π
MongoDB, Inc β kings of the database, honestly π
π COPYRIGHT π
2009-present, MongoDB, Inc.
okay that's the whole page!! you understood it, I'm so proud of you π₯Ήπ
libmongoc β¦ version 2.5.6 β¦ Oct 09, 2026 β mwah, go replace some documents responsibly, ily πβ¨π
π¦ 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