.\" 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_WITH_OPTS" "3" "May 07, 2024" "1.27.1" "libmongoc" .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .EX mongoc_cursor_t * mongoc_cursor_new_from_command_reply_with_opts (mongoc_client_t *client, bson_t *reply, const bson_t *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_with_opts\fP and must not be accessed afterward. .IP \(bu 2 \fBopts\fP: A \fI\%bson_t\fP\&. .UNINDENT .sp \fBopts\fP may be NULL or a BSON document with additional options, which have the same meaning for this function as for \fI\%mongoc_collection_find_with_opts()\fP: .INDENT 0.0 .IP \(bu 2 \fBawaitData\fP .IP \(bu 2 \fBbatchSize\fP .IP \(bu 2 \fBlimit\fP .IP \(bu 2 \fBmaxAwaitTimeMS\fP .IP \(bu 2 \fBserverId\fP .IP \(bu 2 \fBsessionId\fP .IP \(bu 2 \fBskip\fP .IP \(bu 2 \fBtailable\fP .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_with_opts\fP is a low\-level function that initializes a \fI\%mongoc_cursor_t\fP from such a reply. .sp When synthesizing a completed cursor response that has no more batches (i.e. with cursor id 0), \fBserverId\fP may be 0. If the cursor response is not completed (i.e. with non\-zero cursor id), pass the \fBserverId\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. .