public class Find extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Find.Builder
Helper for creating immutable
Find queries. |
Modifier | Constructor and Description |
---|---|
protected |
Find(Find.Builder builder)
Creates a new Find.
|
Modifier and Type | Method and Description |
---|---|
int |
getBatchSize()
Returns the number of documents to be returned in each batch of results.
|
Document |
getHint()
Returns the hint for which index to use.
|
String |
getHintName()
Returns the hint for which index to use by name.
|
int |
getLimit()
Returns the total number of documents to be returned.
|
int |
getNumberToSkip()
Returns the number of documents to skip before returning the first
document.
|
Document |
getQuery()
Returns the query document.
|
ReadPreference |
getReadPreference()
Returns the preference for the servers to retrieve the results from.
|
Document |
getReturnFields()
Returns the fields to be returned from the matching documents.
|
Document |
getSort()
Returns the fields to order document by.
|
boolean |
isPartialOk()
Returns the partial okay value.
|
boolean |
isSnapshot()
If returns true then use snapshot mode to ensure document are only
returned once.
|
Document |
toQueryRequest(boolean explain)
Converts the
Find into a query request document to send to the
MongoDB server. |
Document |
toQueryRequest(boolean explain,
ReadPreference readPreference)
Converts the
Find into a query request document to send to the
MongoDB server including the provided read preferences. |
protected Find(Find.Builder builder)
builder
- The builder to copy the query fields from.public int getBatchSize()
public Document getHint()
public String getHintName()
public int getLimit()
public int getNumberToSkip()
public Document getQuery()
public ReadPreference getReadPreference()
null
in which case the default read preference should be
used.public Document getReturnFields()
public Document getSort()
public boolean isPartialOk()
public boolean isSnapshot()
public Document toQueryRequest(boolean explain)
Find
into a query request document to send to the
MongoDB server.explain
- If true then explain the query procedure instead of returning
results.public Document toQueryRequest(boolean explain, ReadPreference readPreference)
Find
into a query request document to send to the
MongoDB server including the provided read preferences.explain
- If true then explain the query procedure instead of returning
results.readPreference
- The read preference to include in the query request document.Copyright © 2011-2012 Allanbank Consulting, Inc.. All Rights Reserved.