public class Distinct extends Object
Distinct.Builder
is provided to assist in creating a
Distinct
.Modifier and Type | Class and Description |
---|---|
static class |
Distinct.Builder
Builder provides support for creating a
Distinct object. |
Modifier | Constructor and Description |
---|---|
protected |
Distinct(Distinct.Builder builder)
Creates a new Distinct.
|
Modifier and Type | Method and Description |
---|---|
static Distinct.Builder |
builder()
Creates a new builder for a
Distinct . |
String |
getKey()
Returns the name of the key to collect distinct values for.
|
Document |
getQuery()
Returns the query to select the documents to run the distinct against.
|
ReadPreference |
getReadPreference()
Returns the
ReadPreference specifying which servers may be used
to execute the Distinct command. |
protected Distinct(Distinct.Builder builder)
builder
- The builder to copy the state from.IllegalArgumentException
- If neither the key
is null
or
empty.public static Distinct.Builder builder()
Distinct
.Distinct
.public String getKey()
public Document getQuery()
public ReadPreference getReadPreference()
ReadPreference
specifying which servers may be used
to execute the Distinct
command.
If null
then the MongoCollection
instance's
ReadPreference
will be used.
MongoCollection.getReadPreference()
Copyright © 2011-2013 Allanbank Consulting, Inc.. All Rights Reserved.