.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "MONGOC_CURSOR_NEW_FROM_COMMAND_REPLY" "3" "May 07, 2024" "1.27.1" "libmongoc" .sp \fBWARNING:\fP .INDENT 0.0 .INDENT 3.5 Deprecated since version 1.11.0: This function is deprecated and should not be used in new code. .sp Please use \fI\%mongoc_cursor_new_from_command_reply_with_opts()\fP in new code. .sp When migrating from the deprecated \fI\%mongoc_cursor_new_from_command_reply()\fP to \fI\%mongoc_cursor_new_from_command_reply_with_opts()\fP, note that options previously passed to the \fBreply\fP argument (e.g. \(dqbatchSize\(dq) must instead be provided in the \fBopts\fP argument. .UNINDENT .UNINDENT .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .EX mongoc_cursor_t * mongoc_cursor_new_from_command_reply (mongoc_client_t *client, bson_t *reply, uint32_t server_id); BSON_GNUC_DEPRECATED_FOR (mongoc_cursor_new_from_command_reply_with_opts); .EE .UNINDENT .UNINDENT .SH PARAMETERS .INDENT 0.0 .IP \(bu 2 \fBclient\fP: A \fI\%mongoc_client_t\fP\&. .IP \(bu 2 \fBreply\fP: The reply to a command, such as \(dqaggregate\(dq, \(dqfind\(dq, or \(dqlistCollections\(dq, that returns a cursor document. The reply is destroyed by \fBmongoc_cursor_new_from_command_reply\fP and must not be accessed afterward. .IP \(bu 2 \fBserver_id\fP: The opaque id of the server used to execute the command. .UNINDENT .SH DESCRIPTION .sp Some MongoDB commands return a \(dqcursor\(dq document. For example, given an \(dqaggregate\(dq command: .INDENT 0.0 .INDENT 3.5 .sp .EX { \(dqaggregate\(dq : \(dqcollection\(dq, \(dqpipeline\(dq : [], \(dqcursor\(dq : {}} .EE .UNINDENT .UNINDENT .sp The server replies: .INDENT 0.0 .INDENT 3.5 .sp .EX { \(dqcursor\(dq : { \(dqid\(dq : 1234, \(dqns\(dq : \(dqdb.collection\(dq, \(dqfirstBatch\(dq : [ ] }, \(dqok\(dq : 1 } .EE .UNINDENT .UNINDENT .sp \fBmongoc_cursor_new_from_command_reply\fP is a low\-level function that initializes a \fI\%mongoc_cursor_t\fP from such a reply. Additional options such as \(dqtailable\(dq or \(dqawaitData\(dq can be included in the reply. .sp When synthesizing a completed cursor response that has no more batches (i.e. with cursor id 0), \fBserver_id\fP may be 0. If the cursor response is not completed (i.e. with non\-zero cursor id), pass the \fBserver_id\fP of the server used to create the cursor. .sp Use this function only for building a language driver that wraps the C Driver. When writing applications in C, higher\-level functions such as \fI\%mongoc_collection_aggregate()\fP are more appropriate, and ensure compatibility with a range of MongoDB versions. .SH RETURNS .sp A \fI\%mongoc_cursor_t\fP\&. On failure, the cursor\(aqs error is set. Check for failure with \fI\%mongoc_cursor_error()\fP\&. .SH AUTHOR MongoDB, Inc .SH COPYRIGHT 2017-present, MongoDB, Inc .\" Generated by docutils manpage writer. .