1MONGOC_DATABASE_COMMAND_SIMPLE(3) libmongoc MONGOC_DATABASE_COMMAND_SIMPLE(3)
2
3
4
6 bool
7 mongoc_database_command_simple (mongoc_database_t *database,
8 const bson_t *command,
9 const mongoc_read_prefs_t *read_prefs,
10 bson_t *reply,
11 bson_error_t *error);
12
14 • database: A mongoc_database_t.
15
16 • command: A bson_t containing the command.
17
18 • read_prefs: An optional mongoc_read_prefs_t. Otherwise, the command
19 uses mode MONGOC_READ_PRIMARY.
20
21 • reply: A location to store the commands first result document.
22
23 • error: An optional location for a bson_error_t or NULL.
24
25 This is a simplified interface to mongoc_database_command() that re‐
26 turns the first result document. The database's read preference, read
27 concern, and write concern are not applied to the command. The parame‐
28 ter reply is initialized even upon failure to simplify memory manage‐
29 ment.
30
31 This function is not considered a retryable read operation.
32
34 Errors are propagated through the error parameter.
35
37 Returns true if successful. Returns false and sets error if there are
38 invalid arguments or a server or network error.
39
40 This function does not check the server response for a write concern
41 error or write concern timeout.
42
44 MongoDB, Inc
45
47 2017-present, MongoDB, Inc
48
49
50
51
521.25.1 Nov 08, 2023MONGOC_DATABASE_COMMAND_SIMPLE(3)