1MONGOC_DATABASE_DROP_WITH_OPTS(3) libmongoc MONGOC_DATABASE_DROP_WITH_OPTS(3)
2
3
4
6 mongoc_database_drop_with_opts - mongoc_database_drop_with_opts()
7
9 bool
10 mongoc_database_drop_with_opts (mongoc_database_t *database,
11 const bson_t *opts,
12 bson_error_t *error);
13
15 • database: A mongoc_database_t.
16
17 • error: An optional location for a bson_error_t or NULL.
18
19 opts may be NULL or a BSON document with additional command options:
20
21 • writeConcern: Construct a mongoc_write_concern_t and use
22 mongoc_write_concern_append() to add the write concern to opts. See
23 the example code for mongoc_client_write_command_with_opts().
24
25 • sessionId: First, construct a mongoc_client_session_t with
26 mongoc_client_start_session(). You can begin a transaction with
27 mongoc_client_session_start_transaction(), optionally with a
28 mongoc_transaction_opt_t that overrides the options inherited from
29 database, and use mongoc_client_session_append() to add the session
30 to opts. See the example code for mongoc_client_session_t.
31
32 • collation: Configure textual comparisons. See Setting Collation Or‐
33 der, and the MongoDB Manual entry on Collation. Collation requires
34 MongoDB 3.2 or later, otherwise an error is returned.
35
36 • serverId: To target a specific server, include an int32 "serverId"
37 field. Obtain the id by calling mongoc_client_select_server(), then
38 mongoc_server_description_id() on its return value.
39
41 This function attempts to drop a database on the MongoDB server.
42
43 If no write concern is provided in opts, the database's write concern
44 is used.
45
46 The encryptedFields document in opts may be used to drop a collection
47 used for Using Client-Side Field Level Encryption.
48
50 Errors are propagated via the error parameter.
51
53 Returns true if successful. Returns false and sets error if there are
54 invalid arguments or a server or network error.
55
57 MongoDB, Inc
58
60 2017-present, MongoDB, Inc
61
62
63
64
651.23.1 Oct 20, 2022MONGOC_DATABASE_DROP_WITH_OPTS(3)