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 and Type | Field and Description |
---|---|
static Version |
MAX_TIMEOUT_VERSION
The first version of MongoDB to support the
distinct command with
the ability to limit the execution time on the server. |
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.
|
long |
getMaximumTimeMilliseconds()
Returns the maximum amount of time to allow the command to run on the
Server before it is aborted.
|
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. |
public static final Version MAX_TIMEOUT_VERSION
distinct
command with
the ability to limit the execution time on the server.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 long getMaximumTimeMilliseconds()
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–2014 Allanbank Consulting, Inc.. All rights reserved.