1MONGOC_COLLECTION_DELETE_MANY(3)   libmongoc  MONGOC_COLLECTION_DELETE_MANY(3)
2
3
4

NAME

6       mongoc_collection_delete_many - mongoc_collection_delete_many()
7

SYNOPSIS

9          bool
10          mongoc_collection_delete_many (mongoc_collection_t *collection,
11                                         const bson_t *selector,
12                                         const bson_t *opts,
13                                         bson_t *reply,
14                                         bson_error_t *error);
15

PARAMETERS

17       · collection: A mongoc_collection_t.
18
19       · selector: A bson_t containing the query to match documents.
20
21       · reply:  Optional.  An  uninitialized bson_t populated with the delete
22         result, or NULL.
23
24       · error: An optional location for a bson_error_t or NULL.
25
26       opts may be NULL or a BSON document with additional command options:
27
28       · writeConcern:  Construct  a  mongoc_write_concern_t  and   use   mon‐
29         goc_write_concern_append  to  add  the write concern to opts. See the
30         example code for mongoc_client_write_command_with_opts.
31
32       · sessionId:  First,  construct  a  mongoc_client_session_t  with  mon‐
33         goc_client_start_session.  You  can  begin  a  transaction  with mon‐
34         goc_client_session_start_transaction, optionally with a mongoc_trans‐
35         action_opt_t  that  overrides  the options inherited from collection,
36         and use mongoc_client_session_append to add the session to opts.  See
37         the example code for mongoc_client_session_t.
38
39       · validate:     Construct     a     bitwise-or     of    all    desired
40         bson_validate_flags_t. Set to false to skip client-side validation of
41         the provided BSON documents.
42
43       · collation:  Configure  textual  comparisons.  See  Setting  Collation
44         Order, and the MongoDB Manual entry on Collation. Collation  requires
45         MongoDB 3.2 or later, otherwise an error is returned.
46

DESCRIPTION

48       This  function removes all documents in the given collection that match
49       selector.
50
51       To  delete  at  most  one   matching   document,   use   mongoc_collec‐
52       tion_delete_one.
53
54       If you pass a non-NULL reply, it is filled out with the field "deleted‐
55       Count". If there is  a  server  error  then  reply  contains  either  a
56       "writeErrors"  array  with  one  subdocument  or a "writeConcernErrors"
57       array. The reply must be freed with bson_destroy().
58

ERRORS

60       Errors are propagated via the error parameter.
61

RETURNS

63       Returns true if successful. Returns false and sets error if  there  are
64       invalid arguments or a server or network error.
65

AUTHOR

67       MongoDB, Inc
68
70       2017-present, MongoDB, Inc
71
72
73
74
751.16.2                           Feb 25, 2020 MONGOC_COLLECTION_DELETE_MANY(3)
Impressum