mongoc_cursor_clone man page

mongoc_cursor_clone() — This function shall create a copy of a mongoc_cursor_t. The cloned cursor will be reset to the beginning of the query, and therefore the query will be re-executed on the MongoDB server when mongoc_cursor_next() is called.

Synopsis

mongoc_cursor_t *
mongoc_cursor_clone (const mongoc_cursor_t *cursor)
   BSON_GNUC_WARN_UNUSED_RESULT;

Parameters

cursor
A mongoc_cursor_t

Description

This function shall create a copy of a mongoc_cursor_t mongoc_cursor_next(3) is called.

Returns

A newly allocated mongoc_cursor_t that should be freed with mongoc_cursor_destroy(3) when no longer in use.

NOTE

Failure to handle the result of this function is a programming error.

Colophon

This page is part of MongoDB C Driver. Please report any bugs at https://jira.mongodb.org/browse/CDRIVER.

Referenced By

mongoc_cursor_t(3).

2016‐10‐19 MongoDB C Driver