1MONGOC_COLLECTION_UPDATE(3) libmongoc MONGOC_COLLECTION_UPDATE(3)
2
3
4
6 mongoc_collection_update - mongoc_collection_update()
7
9 bool
10 mongoc_collection_update (mongoc_collection_t *collection,
11 mongoc_update_flags_t flags,
12 const bson_t *selector,
13 const bson_t *update,
14 const mongoc_write_concern_t *write_concern,
15 bson_error_t *error);
16
18 • collection: A mongoc_collection_t.
19
20 • flags: A bitwise or of mongoc_update_flags_t.
21
22 • selector: A bson_t containing the query to match documents for updat‐
23 ing.
24
25 • update: A bson_t containing the update to perform. If updating with a
26 pipeline, a bson_t array.
27
28 • write_concern: A mongoc_write_concern_t.
29
30 • error: An optional location for a bson_error_t or NULL.
31
33 Superseded by mongoc_collection_update_one(),
34 mongoc_collection_update_many(), and mongoc_collection_replace_one().
35
36 This function shall update documents in collection that match selector.
37
38 By default, updates only a single document. Set flags to MONGOC_UP‐
39 DATE_MULTI_UPDATE to update multiple documents.
40
42 Errors are propagated via the error parameter.
43
45 Returns true if successful. Returns false and sets error if there are
46 invalid arguments or a server or network error.
47
48 A write concern timeout or write concern error is considered a failure.
49
51 MongoDB, Inc
52
54 2017-present, MongoDB, Inc
55
56
57
58
591.23.1 Oct 20, 2022 MONGOC_COLLECTION_UPDATE(3)