Poco::MongoDB

class QueryRequest

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

Description

Class for creating an OP_QUERY client request. This request is used to query documents from the database.

Inheritance

Direct Base Classes: RequestMessage

All Base Classes: Message, RequestMessage

Member Summary

Member Functions: buildRequest, fullCollectionName, getFlags, getNumberToReturn, getNumberToSkip, returnFieldSelector, selector, setFlags, setNumberToReturn, setNumberToSkip

Inherited Functions: buildRequest, header, messageLength, send

Types

QUERY_NONE

typedef enum { QUERY_NONE = 0, QUERY_TAILABLECURSOR = 2, QUERY_SLAVE_OK = 4, QUERY_NOCUROSR_TIMEOUT = 16, QUERY_AWAIT_DATA = 32, QUERY_EXHAUST = 64, QUERY_PARTIAL = 128 } Flags;

Constructors

QueryRequest

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

Constructor. The full collection name is the concatenation of the database name with the collection name, using a "." for the concatenation. For example, for the database "foo" and the collection "bar", the full collection name is "foo.bar".

Destructor

~QueryRequest virtual

virtual ~QueryRequest();

Destructor

Member Functions

fullCollectionName inline

std::string fullCollectionName() const;

Returns the <db>.<collection> used for this query

getFlags inline

Flags getFlags() const;

Returns the flags

getNumberToReturn inline

Int32 getNumberToReturn() const;

Returns the number to return

getNumberToSkip inline

Int32 getNumberToSkip() const;

Returns the number of documents to skip

returnFieldSelector inline

Document & returnFieldSelector();

Returns the field selector document

selector inline

Document & selector();

Returns the selector document

setFlags inline

void setFlags(
    Flags flag
);

Set the flags

setNumberToReturn inline

void setNumberToReturn(
    Int32 n
);

Sets the number to return (limit)

setNumberToSkip inline

void setNumberToSkip(
    Int32 n
);

Sets the number of documents to skip

buildRequest protected virtual

void buildRequest(
    BinaryWriter & writer
);