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.
|
boolean |
isTailable()
Returns true if the cursur returned from the query will be tailable,
false otherwise.
|
Document |
toQueryRequest(boolean explain)
This method is not intended for applications to use.
|
Document |
toQueryRequest(boolean explain,
ReadPreference readPreference)
This method is not intended for applications to use.
|
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 boolean isTailable()
Find.Builder.setTailable(boolean) for
important usage information.
public Document toQueryRequest(boolean explain)
Find
object to the appropriate method on the
MongoCollection
interface. This method is used internally by the
driver and is public for cross package access only.
Converts the Find
into a raw 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
object to the appropriate method on the
MongoCollection
interface. This method is used internally by the
driver and is public for cross package access only.
Converts the Find
into a raw 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-2013 Allanbank Consulting, Inc.. All Rights Reserved.