1MONGOC_COLLECTION_REMOVE(3) libmongoc MONGOC_COLLECTION_REMOVE(3)
2
3
4
6 bool
7 mongoc_collection_remove (mongoc_collection_t *collection,
8 mongoc_remove_flags_t flags,
9 const bson_t *selector,
10 const mongoc_write_concern_t *write_concern,
11 bson_error_t *error);
12
14 • collection: A mongoc_collection_t.
15
16 • flags: A mongoc_remove_flags_t.
17
18 • selector: A bson_t containing the query to match documents.
19
20 • write_concern: A mongoc_write_concern_t or NULL.
21
22 • error: An optional location for a bson_error_t or NULL.
23
25 Superseded by mongoc_collection_delete_one() and
26 mongoc_collection_delete_many().
27
28 This function shall remove documents in the given collection that match
29 selector. The bson selector is not validated, simply passed along as
30 appropriate to the server. As such, compatibility and errors should be
31 validated in the appropriate server documentation.
32
33 If you want to limit deletes to a single document, provide MONGOC_RE‐
34 MOVE_SINGLE_REMOVE in flags.
35
37 Errors are propagated via the error parameter.
38
40 Returns true if successful. Returns false and sets error if there are
41 invalid arguments or a server or network error.
42
44 MongoDB, Inc
45
47 2017-present, MongoDB, Inc
48
49
50
51
521.25.1 Nov 08, 2023 MONGOC_COLLECTION_REMOVE(3)