1MONGOC_CLIENT_COMMAND(3) libmongoc MONGOC_CLIENT_COMMAND(3)
2
3
4
6 mongoc_client_command - mongoc_client_command()
7
9 mongoc_cursor_t *
10 mongoc_client_command (mongoc_client_t *client,
11 const char *db_name,
12 mongoc_query_flags_t flags,
13 uint32_t skip,
14 uint32_t limit,
15 uint32_t batch_size,
16 const bson_t *query,
17 const bson_t *fields,
18 const mongoc_read_prefs_t *read_prefs)
19 BSON_GNUC_WARN_UNUSED_RESULT;
20
21 This function is superseded by mongoc_client_command_with_opts(),
22 mongoc_client_read_command_with_opts(),
23 mongoc_client_write_command_with_opts(), and
24 mongoc_client_read_write_command_with_opts().
25
26 This function is not considered a retryable read operation.
27
29 This function creates a cursor which will execute the command when
30 mongoc_cursor_next() is called on it. The client's read preference,
31 read concern, and write concern are not applied to the command, and
32 mongoc_cursor_next() will not check the server response for a write
33 concern error or write concern timeout.
34
35 If mongoc_cursor_next() returns false, then retrieve error details with
36 mongoc_cursor_error() or mongoc_cursor_error_document().
37
39 • client: A mongoc_client_t.
40
41 • db_name: The name of the database to run the command on.
42
43 • flags: Unused.
44
45 • skip: Unused.
46
47 • limit: Unused.
48
49 • batch_size: Unused.
50
51 • query: A bson_t containing the command specification.
52
53 • fields: Unused.
54
55 • read_prefs: An optional mongoc_read_prefs_t. Otherwise, the command
56 uses mode MONGOC_READ_PRIMARY.
57
59 A mongoc_cursor_t.
60
61 The cursor should be freed with mongoc_cursor_destroy().
62
64 MongoDB, Inc
65
67 2017-present, MongoDB, Inc
68
69
70
71
721.24.3 Aug 17, 2023 MONGOC_CLIENT_COMMAND(3)