Modifier and Type | Field and Description |
---|---|
protected int |
myBatchSize
The number of documents to be returned in each batch of results.
|
protected int |
myLimit
The total number of documents to be returned.
|
protected int |
myNumberToSkip
The number of documents to skip before returning the first document.
|
protected boolean |
myPartialOk
If true then an error in the query should return any partial results.
|
protected Document |
myQuery
The query document.
|
protected ReadPreference |
myReadPreference
The preference for which servers to use to retrieve the results.
|
protected Document |
myReturnFields
The fields to be returned from the matching documents.
|
protected Document |
mySort
The fields to order the document on.
|
Constructor and Description |
---|
Find.Builder()
Creates a new Builder.
|
Find.Builder(DocumentAssignable query)
Creates a new Builder.
|
Modifier and Type | Method and Description |
---|---|
Find |
build()
Constructs a new
Find object from the state of the builder. |
Find.Builder |
setBatchSize(int batchSize)
Sets the value of the number of documents to be returned in each
batch.
|
Find.Builder |
setLimit(int limit)
Sets the value of the total number of documents to be returned.
|
Find.Builder |
setNumberToSkip(int numberToSkip)
Sets the value of the number of documents to skip before returning
the first document to the new value.
|
Find.Builder |
setPartialOk(boolean partialOk)
Sets the value of partial okay to the new value.
|
Find.Builder |
setQuery(DocumentAssignable query)
Sets the value of the query document to the new value.
|
Find.Builder |
setReadPreference(ReadPreference readPreference)
Sets the preference for the set of servers to retrieve the results
from.
|
Find.Builder |
setReturnFields(DocumentAssignable returnFields)
Sets the value of the fields to be returned from the matching
documents to the new value.
|
Find.Builder |
setSort(DocumentAssignable sortFields)
Sets the value of the fields to to sort matching documents by.
|
Find.Builder |
setSort(IntegerElement... sortFields)
Sets the value of the fields to to sort matching documents by.
|
protected int myBatchSize
protected int myLimit
protected int myNumberToSkip
protected boolean myPartialOk
protected Document myQuery
protected ReadPreference myReadPreference
protected Document myReturnFields
protected Document mySort
public Find.Builder()
public Find.Builder(DocumentAssignable query)
query
- The query document.public Find build()
Find
object from the state of the builder.Find
object.public Find.Builder setBatchSize(int batchSize)
batchSize
- The new value for the number of documents to be returned
in each batch.public Find.Builder setLimit(int limit)
limit
- The new value for the total number of documents to be
returned.public Find.Builder setNumberToSkip(int numberToSkip)
numberToSkip
- The new value for the number of documents to skip before
returning the first document.public Find.Builder setPartialOk(boolean partialOk)
partialOk
- The new value for the partial okay.public Find.Builder setQuery(DocumentAssignable query)
query
- The new value for the query document.public Find.Builder setReadPreference(ReadPreference readPreference)
readPreference
- The new value for the preference of which server to return
the results from.public Find.Builder setReturnFields(DocumentAssignable returnFields)
returnFields
- The new value for the fields to be returned from the
matching documents.public Find.Builder setSort(DocumentAssignable sortFields)
sortFields
- The new value for the fields to sort matching documents
by.public Find.Builder setSort(IntegerElement... sortFields)
This method is intended to be used with the Sort
class's
static methods:
import static
com.allanbank.mongodb.builder.Sort.asc
; import staticcom.allanbank.mongodb.builder.Sort.desc
; Find.Builder builder = new Find.Builder(); builder.setSort( asc("f"), desc("g") ); ...
sortFields
- The new value for the fields to sort matching documents
by.Copyright © 2011-2012 Allanbank Consulting, Inc.. All Rights Reserved.