# Poco::MongoDB

# class ResponseMessage

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

## Description

This class represents a response (OP_REPLY) from MongoDB.

## Inheritance

Direct Base Classes: Message

All Base Classes: Message

## Member Summary

Member Functions: clear, count, cursorID, documents, empty, hasDocuments, read

Inherited Functions: header, messageLength

## Constructors

### ResponseMessage

ResponseMessage();

Creates an empty ResponseMessage.

### ResponseMessage

ResponseMessage(
const Int64 & cursorID
);

Creates an ResponseMessage for existing cursor ID.

## Destructor

### ~ResponseMessage

virtual ~ResponseMessage();

Destroys the ResponseMessage.

## Member Functions

### clear

void clear();

Clears the response.

### count

std::size_t count() const;

Returns the number of documents in the response.

### cursorID

Int64 cursorID() const;

Returns the cursor ID.

### documents

Document::Vector & documents();

Returns a vector containing the received documents.

### empty

bool empty() const;

Returns true if the response does not contain any documents.

### hasDocuments

bool hasDocuments() const;

Returns true if there is at least one document in the response.

### read

void read(
std::istream & istr
);

Reads the response from the stream.