Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
MONGOC_CURSOR_..._COMMAND_REPLY(3) libmongocMONGOC_CURSOR_..._COMMAND_REPLY(3)

WARNING:
	  Deprecated	     since	   version	   1.11.0:	   Use
	  mongoc_cursor_new_from_command_reply_with_opts() instead.

	  When	       migrating	 from	       the	    deprecated
	  mongoc_cursor_new_from_command_reply()			    to
	  mongoc_cursor_new_from_command_reply_with_opts(), note that  options
	  previously  passed to	the reply argument (e.g. "batchSize") must in-
	  stead	be provided in the opts	argument.

SYNOPSIS
	  mongoc_cursor_t *
	  mongoc_cursor_new_from_command_reply (mongoc_client_t	*client,
						bson_t *reply,
						uint32_t server_id);

PARAMETERS
        client: A mongoc_client_t.

        reply:	The reply to a command,	such as	"aggregate", "find", or	"list-
	 Collections", that returns a cursor document. The reply is  destroyed
	 by  mongoc_cursor_new_from_command_reply and must not be accessed af-
	 terward.

        server_id: The	opaque id of the server	used to	execute	the command.

DESCRIPTION
       Some MongoDB commands return a "cursor" document. For example, given an
       "aggregate" command:

	  { "aggregate"	: "collection",	"pipeline" : [], "cursor" : {}}

       The server replies:

	  {
	     "cursor" :	{
		"id" : 1234,
		"ns" : "db.collection",
		"firstBatch" : [ ]
	     },
	     "ok" : 1
	  }

       mongoc_cursor_new_from_command_reply is a low-level function that  ini-
       tializes	 a  mongoc_cursor_t from such a	reply. Additional options such
       as "tailable" or	"awaitData" can	be included in the reply.

       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.

       Use this	function only for building a language driver that wraps	the  C
       Driver.	When writing applications in C,	higher-level functions such as
       mongoc_collection_aggregate() are more appropriate, and ensure compati-
       bility with a range of MongoDB versions.

RETURNS
       A mongoc_cursor_t. On failure, the cursor's error  is  set.  Check  for
       failure with mongoc_cursor_error().

AUTHOR
       MongoDB,	Inc

COPYRIGHT
       2009-present, MongoDB, Inc.

1.30.2				 Apr 12, 202MONGOC_CURSOR_..._COMMAND_REPLY(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=mongoc_cursor_new_from_command_reply&sektion=3&manpath=FreeBSD+Ports+14.3.quarterly>

home | help