1MONGOC_COLLECTION_DELETE(3) libmongoc MONGOC_COLLECTION_DELETE(3)
2
3
4
6 mongoc_collection_delete - mongoc_collection_delete()
7
8 WARNING:
9 Deprecated since version 1.9.0: This function is deprecated and
10 should not be used in new code.
11
12 Please use mongoc_collection_delete_one() or
13 mongoc_collection_delete_many() in new code.
14
15
17 bool
18 mongoc_collection_delete (mongoc_collection_t *collection,
19 mongoc_delete_flags_t flags,
20 const bson_t *selector,
21 const mongoc_write_concern_t *write_concern,
22 bson_error_t *error)
23 BSON_GNUC_DEPRECATED_FOR (mongoc_collection_delete_one or
24 mongoc_collection_delete_many);
25
27 • collection: A mongoc_collection_t.
28
29 • flags: A mongoc_delete_flags_t.
30
31 • selector: A bson_t containing the query to match documents.
32
33 • write_concern: A mongoc_write_concern_t or NULL.
34
35 • error: An optional location for a bson_error_t or NULL.
36
38 This function shall delete documents in the given collection that match
39 selector. The bson selector is not validated, simply passed along as
40 appropriate to the server. As such, compatibility and errors should be
41 validated in the appropriate server documentation.
42
43 If you want to limit deletes to a single document, provide MON‐
44 GOC_DELETE_SINGLE_REMOVE in flags.
45
47 Errors are propagated via the error parameter.
48
50 Returns true if successful. Returns false and sets error if there are
51 invalid arguments or a server or network error.
52
53 A write concern timeout or write concern error is considered a failure.
54
56 MongoDB, Inc
57
59 2017-present, MongoDB, Inc
60
61
62
63
641.24.3 Aug 17, 2023 MONGOC_COLLECTION_DELETE(3)