Class Poco::MongoDB::Cursor
Author: Applied Informatics Software Engineering GmbH and Contributors

# Poco::MongoDB

# class Cursor

Library: MongoDB
Package: MongoDB
Header: Poco/MongoDB/Cursor.h

## Description

Cursor is an helper class for querying multiple documents

## Inheritance

Direct Base Classes: Document

All Base Classes: Document

## Member Summary

Member Functions: kill, next, query

Inherited Functions: add, addElement, addNewDocument, clear, elementNames, empty, exists, get, isType, read, size, toString, write

## Constructors

### Cursor

Cursor(
const std::string & fullCollectionName,
QueryRequest::Flags flags = QueryRequest::QUERY_NONE
);

Constructor

### Cursor

Cursor(
const std::string & dbname,
const std::string & collectionName,
QueryRequest::Flags flags = QueryRequest::QUERY_NONE
);

Constructor

## Destructor

### ~Cursor

virtual ~Cursor();

Destructor

## Member Functions

### kill

void kill(
Connection & connection
);

Kills the cursor and reset it so that it can be reused.

### next

ResponseMessage & next(
Connection & connection
);

Try to get the next documents. As long as ResponseMessage has a cursor id next can be called to retrieve the next bunch of documents. kill must be called when not all documents are needed.

### query

QueryRequest & query();

Returns the associated query