1MONGOC_CURSOR_NEW_FROM_COMMANDM_ORNEGPOLCYl__iCWbUImRToSHnO_gROo_PcNTESW(_3F)ROM_COMMAND_REPLY_WITH_OPTS(3)
2
3
4
6 mongoc_cursor_new_from_command_reply_with_opts - mongoc_cur‐
7 sor_new_from_command_reply_with_opts()
8
10 mongoc_cursor_t *
11 mongoc_cursor_new_from_command_reply_with_opts (mongoc_client_t *client,
12 bson_t *reply,
13 const bson_t *opts);
14
16 • client: A mongoc_client_t.
17
18 • reply: The reply to a command, such as "aggregate", "find", or "list‐
19 Collections", that returns a cursor document. The reply is destroyed
20 by mongoc_cursor_new_from_command_reply_with_opts and must not be ac‐
21 cessed afterward.
22
23 • opts: A bson_t.
24
25 opts may be NULL or a BSON document with additional options, which have
26 the same meaning for this function as for
27 mongoc_collection_find_with_opts():
28
29 • awaitData
30
31 • batchSize
32
33 • limit
34
35 • maxAwaitTimeMS
36
37 • serverId
38
39 • sessionId
40
41 • skip
42
43 • tailable
44
46 Some MongoDB commands return a "cursor" document. For example, given an
47 "aggregate" command:
48
49 { "aggregate" : "collection", "pipeline" : [], "cursor" : {}}
50
51 The server replies:
52
53 {
54 "cursor" : {
55 "id" : 1234,
56 "ns" : "db.collection",
57 "firstBatch" : [ ]
58 },
59 "ok" : 1
60 }
61
62 mongoc_cursor_new_from_command_reply_with_opts is a low-level function
63 that initializes a mongoc_cursor_t from such a reply.
64
65 Use this function only for building a language driver that wraps the C
66 Driver. When writing applications in C, higher-level functions such as
67 mongoc_collection_aggregate() are more appropriate, and ensure compati‐
68 bility with a range of MongoDB versions.
69
71 A mongoc_cursor_t. On failure, the cursor's error is set. Check for
72 failure with mongoc_cursor_error().
73
75 MongoDB, Inc
76
78 2017-present, MongoDB, Inc
79
80
81
82
831.23.1 MONGOOcCt_C2U0R,SO2R0_2N2EW_FROM_COMMAND_REPLY_WITH_OPTS(3)