MONGOC_BULK_O...MANY_WITH_OPTS(3)
hiii bestie π welcome to the MONGOC_BULK_O...MANY_WITH_OPTS(3) page from libmongoc β yes the title got truncated, but the function is mongoc_bulk_operation_update_many_with_opts() and she is that girl β¨
β¨ SYNOPSIS β¨
bool
mongoc_bulk_operation_update_many_with_opts (mongoc_bulk_operation_t *bulk,
const bson_t *selector,
const bson_t *document,
const bson_t *opts,
bson_error_t *error); /* OUT */
Okay so this function queues an update as part of a bulk operation. It does not execute the operation, bestie β it just lines it up. To execute the entirety of the bulk operation, call mongoc_bulk_operation_execute(). Periodt π
β οΈ WARNING:documentMUST only contain fields whose key starts with$. See the update document specification for more details. No cap, this one matters π
π PARAMETERS π
bulkβ amongoc_bulk_operation_t. The main-character bulk operation itself πselectorβ abson_tthat selects which documents to remove.documentβ abson_tcontaining the update document.errorβ abson_error_tany errors that may have occurred. That's where the yikes go π
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. Lowkey useful, highkey valid β¨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. Respect the version, bestie π«Άhintβ a document or string that specifies the index to use to support the query predicate. It's giving "use the right index" energy π₯upsertβ iftrue, insert a document if none matchselector. Surprise insertion moment πarrayFiltersβ an array of filters specifying to which array elements an update should apply. For when you need to be specific-specific π
π ERRORS π
Operation errors are propagated via mongoc_bulk_operation_execute(), while argument validation errors are reported by the error argument. So yeah β some drama shows up at execute time, some shows up in error π«
π RETURNS π
Returns true on success, and false if there is a server or network error or if passed invalid arguments. Simple vibe check: true slays, false means something went off π
π SEE ALSO π
mongoc_bulk_operation_update_one_with_opts() β go read that one too, bestie π
π«Ά AUTHOR π«Ά
MongoDB, Inc
π COPYRIGHT π
2009-present, MongoDB, Inc.
okay byeee bestie π β this was libmongoc 2.5.6, dated Oct 09, 2026. mwah ππ
π¦ 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