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

SYNOPSIS

6          bool
7          mongoc_collection_delete_many (mongoc_collection_t *collection,
8                                         const bson_t *selector,
9                                         const bson_t *opts,
10                                         bson_t *reply,
11                                         bson_error_t *error);
12

PARAMETERS

14collection: A mongoc_collection_t.
15
16selector: A bson_t containing the query to match documents.
17
18reply:  Optional.  An  uninitialized bson_t populated with the delete
19         result, or NULL.
20
21error: An optional location for a bson_error_t or NULL.
22
23       opts may be NULL or a BSON document with additional command options:
24
25writeConcern:   Construct   a    mongoc_write_concern_t    and    use
26         mongoc_write_concern_append()  to  add the write concern to opts. See
27         the example code for mongoc_client_write_command_with_opts().
28
29sessionId:   First,   construct   a   mongoc_client_session_t    with
30         mongoc_client_start_session().  You  can  begin  a  transaction  with
31         mongoc_client_session_start_transaction(),    optionally    with    a
32         mongoc_transaction_opt_t  that  overrides  the options inherited from
33         collection, and use mongoc_client_session_append() to add the session
34         to opts. See the example code for mongoc_client_session_t.
35
36validate:     Construct     a     bitwise-or     of    all    desired
37         bson_validate_flags_t. Set to false to skip client-side validation of
38         the provided BSON documents.
39
40comment: A bson_value_t specifying the comment to attach to this com‐
41         mand. The comment will appear in log messages, profiler  output,  and
42         currentOp output. Requires MongoDB 4.4 or later.
43
44collation:  Configure  textual comparisons. See Setting Collation Or‐
45         der, and the MongoDB Manual entry on  Collation.  Collation  requires
46         MongoDB 3.2 or later, otherwise an error is returned.
47
48hint: A document or string that specifies the index to use to support
49         the query predicate.
50
51let: A BSON document consisting of any  number  of  parameter  names,
52         each  followed  by  definitions of constants in the MQL Aggregate Ex‐
53         pression language.
54

DESCRIPTION

56       This function removes all documents in the given collection that  match
57       selector.
58
59       To     delete     at     most     one     matching     document,    use
60       mongoc_collection_delete_one().
61
62       If you pass a non-NULL reply, it is filled out with the field "deleted‐
63       Count".  If  there  is  a  server  error  then  reply contains either a
64       "writeErrors" array with one subdocument or a "writeConcernErrors"  ar‐
65       ray. The reply must be freed with bson_destroy().
66

ERRORS

68       Errors are propagated via the error parameter.
69

RETURNS

71       Returns  true  if successful. Returns false and sets error if there are
72       invalid arguments or a server or network error.
73

AUTHOR

75       MongoDB, Inc
76
78       2017-present, MongoDB, Inc
79
80
81
82
831.25.1                           Nov 08, 2023 MONGOC_COLLECTION_DELETE_MANY(3)
Impressum