QUERY packet

A QUERY packet is sent by a client to query the database for documents in a collection. For full details, see the MongoDB documentation.


Methods

int getQueryFlags()
Returns the query flags -- see the MongoDB documentation for details.

void setQueryFlags(int flags)
Sets the flags to the specified value.

String getFullCollectionName()
Returns the full name of the collection being queried.

void setFullCollectionName(String name)
Sets the full name of the collection being queried.

int getNumberToSkip()
Returns the number of documents to skip.

void setNumberToSkip(int n)
Sets the number of documents to skip.

int getNumberToReturn()
Gets the maximum number of documents to return for this query.

void setNumberToReturn(int n)
Sets the maximum number of documents to return for this query.

BSONObject getQuery()
Returns the document defining the query. See the MongoDB documentation for the format of this document.

object getQueryJson()
Like getQuery(), but returns a JavaScript-friendly object.

BSONObject getReturnFieldsSelector()
Returns the (optional) document specifying which fields should be included in the response to this query. See the MongoDB documentation for the format of this document.

object getReturnFieldsSelectorJson()
Like getReturnFieldsSelector(), but returns a JavaScript-friendly object (or null if there is no document).