public class GroupBy extends Object
GroupBy.Builder
is provided to assist in creating a
GroupBy
.Modifier and Type | Class and Description |
---|---|
static class |
GroupBy.Builder
Builder provides a builder for Group commands.
|
Modifier and Type | Field and Description |
---|---|
static Version |
MAX_TIMEOUT_VERSION
The first version of MongoDB to support the
group command with
the ability to limit the execution time on the server. |
Modifier | Constructor and Description |
---|---|
protected |
GroupBy(GroupBy.Builder builder)
Creates a new GroupBy.
|
Modifier and Type | Method and Description |
---|---|
static GroupBy.Builder |
builder()
Creates a new builder for a
GroupBy . |
String |
getFinalizeFunction()
Returns the finalizer function to run for each group.
|
Document |
getInitialValue()
Returns the initial value for each group.
|
String |
getKeyFunction()
Returns the function to return the key for a document.
|
Set<String> |
getKeys()
Returns the fields to group by.
|
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 group against.
|
ReadPreference |
getReadPreference()
Returns the
ReadPreference specifying which servers may be used
to execute the GroupBy command. |
String |
getReduceFunction()
Returns the reduce function taking the previous value and the current
value and returning the new reduced value.
|
public static final Version MAX_TIMEOUT_VERSION
group
command with
the ability to limit the execution time on the server.protected GroupBy(GroupBy.Builder builder) throws IllegalArgumentException
builder
- The builder to copy the state from.IllegalArgumentException
- If neither the keys
nor
key function
have been set.public static GroupBy.Builder builder()
GroupBy
.GroupBy
.public String getFinalizeFunction()
public Document getInitialValue()
public String getKeyFunction()
getKeys()
to dynamically determine the group for each
document.getKeys()
to dynamically determine the group for each
document.public Set<String> getKeys()
public long getMaximumTimeMilliseconds()
public Document getQuery()
public ReadPreference getReadPreference()
ReadPreference
specifying which servers may be used
to execute the GroupBy
command.
If null
then the MongoCollection
instance's
ReadPreference
will be used.
MongoCollection.getReadPreference()
public String getReduceFunction()
Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.