Library: MongoDB
Package: MongoDB
Header: Poco/MongoDB/QueryRequest.h
Class for creating an OP_QUERY client request. This request is used to query documents from the database.
Direct Base Classes: RequestMessage
All Base Classes: Message, RequestMessage
Member Functions: buildRequest, fullCollectionName, getFlags, getNumberToReturn, getNumberToSkip, returnFieldSelector, selector, setFlags, setNumberToReturn, setNumberToSkip
Inherited Functions: buildRequest, header, messageLength, send
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;
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".
virtual ~QueryRequest();
Destructor
std::string fullCollectionName() const;
Returns the <db>.<collection> used for this query
Flags getFlags() const;
Returns the flags
Int32 getNumberToReturn() const;
Returns the number to return
Int32 getNumberToSkip() const;
Returns the number of documents to skip
Document & returnFieldSelector();
Returns the field selector document
Document & selector();
Returns the selector document
void setFlags(
Flags flag
);
Set the flags
void setNumberToReturn(
Int32 n
);
Sets the number to return (limit)
void setNumberToSkip(
Int32 n
);
Sets the number of documents to skip
void buildRequest(
BinaryWriter & writer
);