You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CDRIVER-3969 error when creating uncompleted cursor with no server ID (#1321)
* fix type of BCON_INT32 value
* require serverID for open cursor with `mongoc_cursor_new_from_command_reply_with_opts`
* document expectations of server ID option
* assert `found` after `mongoc_cursor_error`
If an error occurs, `found` is false. Assert on the error first to print the error.
* remove unnecessary nested `if`
Copy file name to clipboardExpand all lines: src/libmongoc/doc/mongoc_cursor_new_from_command_reply.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ The server replies:
55
55
56
56
``mongoc_cursor_new_from_command_reply`` is a low-level function that initializes a :symbol:`mongoc_cursor_t` from such a reply. Additional options such as "tailable" or "awaitData" can be included in the reply.
57
57
58
-
When synthesizing a completed cursor response that has no more batches (i.e. with cursor id 0), set ``server_id`` to 0 as well.
58
+
When synthesizing a completed cursor response that has no more batches (i.e. with cursor id 0), ``server_id`` may be 0. If the cursor response is not completed (i.e. with non-zero cursor id), pass the ``server_id`` of the server used to create the cursor.
59
59
60
60
Use this function only for building a language driver that wraps the C Driver. When writing applications in C, higher-level functions such as :symbol:`mongoc_collection_aggregate` are more appropriate, and ensure compatibility with a range of MongoDB versions.
Copy file name to clipboardExpand all lines: src/libmongoc/doc/mongoc_cursor_new_from_command_reply_with_opts.rst
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,8 @@ The server replies:
55
55
56
56
``mongoc_cursor_new_from_command_reply_with_opts`` is a low-level function that initializes a :symbol:`mongoc_cursor_t` from such a reply.
57
57
58
+
When synthesizing a completed cursor response that has no more batches (i.e. with cursor id 0), ``serverId`` may be 0. If the cursor response is not completed (i.e. with non-zero cursor id), pass the ``serverId`` of the server used to create the cursor.
59
+
58
60
Use this function only for building a language driver that wraps the C Driver. When writing applications in C, higher-level functions such as :symbol:`mongoc_collection_aggregate` are more appropriate, and ensure compatibility with a range of MongoDB versions.
0 commit comments