MongoDB C++ Driver  mongocxx-3.1.3
Classes | Public Member Functions | List of all members
mongocxx::cursor Class Reference

Class representing a pointer to the result set of a query on a MongoDB server. More...

#include <cursor.hpp>

Classes

class  iterator
 Class representing an input iterator of documents in a MongoDB cursor result set. More...
 

Public Member Functions

 cursor (cursor &&) noexcept
 Move constructs a cursor.
 
cursoroperator= (cursor &&) noexcept
 Move assigns a cursor.
 
 ~cursor ()
 Destroys a cursor.
 
iterator begin ()
 A cursor::iterator that points to the beginning of any available results. More...
 
iterator end ()
 A cursor::iterator that points to the end of the results. More...
 

Detailed Description

Class representing a pointer to the result set of a query on a MongoDB server.

Clients can iterate through a cursor::iterator to retrieve results.

Note
By default, cursors timeout after 10 minutes of inactivity.

Member Function Documentation

◆ begin()

iterator mongocxx::cursor::begin ( )

A cursor::iterator that points to the beginning of any available results.

If begin() is called more than once, the cursor::iterator returned points to the next remaining result, not the result of the original call to begin().

Returns
the cursor::iterator
Exceptions
mongocxx::query_exceptionif the query failed

◆ end()

iterator mongocxx::cursor::end ( )

A cursor::iterator that points to the end of the results.

Returns
the cursor::iterator

The documentation for this class was generated from the following file: