Package com.mongodb.operation
Class MapReduceWithInlineResultsOperation<T>
java.lang.Object
com.mongodb.operation.MapReduceWithInlineResultsOperation<T>
- Type Parameters:
T- the operations result type.
- All Implemented Interfaces:
AsyncReadOperation<MapReduceAsyncBatchCursor<T>>,ReadOperation<MapReduceBatchCursor<T>>
@Deprecated
public class MapReduceWithInlineResultsOperation<T>
extends Object
implements AsyncReadOperation<MapReduceAsyncBatchCursor<T>>, ReadOperation<MapReduceBatchCursor<T>>
Deprecated.
Operation that runs a Map Reduce against a MongoDB instance. This operation only supports "inline" results, i.e. the results will be returned as a result of running this operation.
To run a map reduce operation into a given collection, use MapReduceToCollectionOperation.
- Since:
- 3.0
-
Constructor Summary
ConstructorsConstructorDescriptionMapReduceWithInlineResultsOperation(MongoNamespace namespace, BsonJavaScript mapFunction, BsonJavaScript reduceFunction, Decoder<T> decoder) Deprecated.Construct a MapReduceOperation with all the criteria it needs to execute. -
Method Summary
Modifier and TypeMethodDescriptionasExplainableOperation(ExplainVerbosity explainVerbosity) Deprecated.Gets an operation whose execution explains this operation.asExplainableOperationAsync(ExplainVerbosity explainVerbosity) Deprecated.Gets an operation whose execution explains this operation.Deprecated.Sets the collation optionsexecute(ReadBinding binding) Deprecated.Executing this will return a cursor with your results and the statistics in.voidexecuteAsync(AsyncReadBinding binding, SingleResultCallback<MapReduceAsyncBatchCursor<T>> callback) Deprecated.General execute which can return anything of type Tfilter(BsonDocument filter) Deprecated.Sets the filter to apply to the query.finalizeFunction(BsonJavaScript finalizeFunction) Deprecated.Sets the JavaScript function that follows the reduce method and modifies the output.Deprecated.Returns the collation optionsDeprecated.Gets the decoder used to decode the result documents.Deprecated.Gets the query filter.Deprecated.Gets the JavaScript function that follows the reduce method and modifies the output.intgetLimit()Deprecated.Gets the limit to apply.Deprecated.Gets the JavaScript function that associates or "maps" a value with a key and emits the key and value pair.longgetMaxTime(TimeUnit timeUnit) Deprecated.Gets the maximum execution time on the server for this operation.Deprecated.Gets the namespace.Deprecated.Gets the JavaScript function that "reduces" to a single object all the values associated with a particular key.getScope()Deprecated.Gets the global variables that are accessible in the map, reduce and finalize functions.getSort()Deprecated.Gets the sort criteria to apply to the query.booleanisJsMode()Deprecated.Gets the flag that specifies whether to convert intermediate data into BSON format between the execution of the map and reduce functions.booleanDeprecated.Gets whether to include the timing information in the result information.jsMode(boolean jsMode) Deprecated.Sets the flag that specifies whether to convert intermediate data into BSON format between the execution of the map and reduce functions.limit(int limit) Deprecated.Sets the limit to apply.Deprecated.Sets the maximum execution time on the server for this operation.scope(BsonDocument scope) Deprecated.Sets the global variables that are accessible in the map, reduce and finalize functions.sort(BsonDocument sort) Deprecated.Sets the sort criteria to apply to the query.verbose(boolean verbose) Deprecated.Sets whether to include the timing information in the result information.
-
Constructor Details
-
MapReduceWithInlineResultsOperation
public MapReduceWithInlineResultsOperation(MongoNamespace namespace, BsonJavaScript mapFunction, BsonJavaScript reduceFunction, Decoder<T> decoder) Deprecated.Construct a MapReduceOperation with all the criteria it needs to execute.- Parameters:
namespace- the database and collection namespace for the operation.mapFunction- a JavaScript function that associates or "maps" a value with a key and emits the key and value pair.reduceFunction- a JavaScript function that "reduces" to a single object all the values associated with a particular key.decoder- the decoder for the result documents.
-
-
Method Details
-
getNamespace
Deprecated.Gets the namespace.- Returns:
- the namespace
- Since:
- 3.4
-
getDecoder
Deprecated.Gets the decoder used to decode the result documents.- Returns:
- the decoder
- Since:
- 3.4
-
getMapFunction
Deprecated.Gets the JavaScript function that associates or "maps" a value with a key and emits the key and value pair.- Returns:
- the JavaScript function that associates or "maps" a value with a key and emits the key and value pair.
-
getReduceFunction
Deprecated.Gets the JavaScript function that "reduces" to a single object all the values associated with a particular key.- Returns:
- the JavaScript function that "reduces" to a single object all the values associated with a particular key.
-
getFinalizeFunction
Deprecated.Gets the JavaScript function that follows the reduce method and modifies the output. Default is null- Returns:
- the JavaScript function that follows the reduce method and modifies the output.
-
finalizeFunction
Deprecated.Sets the JavaScript function that follows the reduce method and modifies the output.- Parameters:
finalizeFunction- the JavaScript function that follows the reduce method and modifies the output.- Returns:
- this
-
getScope
Deprecated.Gets the global variables that are accessible in the map, reduce and finalize functions.- Returns:
- the global variables that are accessible in the map, reduce and finalize functions.
-
scope
Deprecated.Sets the global variables that are accessible in the map, reduce and finalize functions.- Parameters:
scope- the global variables that are accessible in the map, reduce and finalize functions.- Returns:
- this
-
getFilter
Deprecated.Gets the query filter.- Returns:
- the query filter
-
filter
Deprecated.Sets the filter to apply to the query.- Parameters:
filter- the filter to apply to the query.- Returns:
- this
-
getSort
Deprecated.Gets the sort criteria to apply to the query. The default is null, which means that the documents will be returned in an undefined order.- Returns:
- a document describing the sort criteria
-
sort
Deprecated.Sets the sort criteria to apply to the query.- Parameters:
sort- the sort criteria, which may be null.- Returns:
- this
-
getLimit
public int getLimit()Deprecated.Gets the limit to apply. The default is null.- Returns:
- the limit
-
limit
Deprecated.Sets the limit to apply.- Parameters:
limit- the limit, which may be null- Returns:
- this
-
isJsMode
public boolean isJsMode()Deprecated.Gets the flag that specifies whether to convert intermediate data into BSON format between the execution of the map and reduce functions. Defaults to false.- Returns:
- jsMode
-
jsMode
Deprecated.Sets the flag that specifies whether to convert intermediate data into BSON format between the execution of the map and reduce functions. Defaults to false.- Parameters:
jsMode- the flag that specifies whether to convert intermediate data into BSON format between the execution of the map and reduce functions- Returns:
- jsMode
-
isVerbose
public boolean isVerbose()Deprecated.Gets whether to include the timing information in the result information. Defaults to true.- Returns:
- whether to include the timing information in the result information
-
verbose
Deprecated.Sets whether to include the timing information in the result information.- Parameters:
verbose- whether to include the timing information in the result information.- Returns:
- this
-
getCollation
Deprecated.Returns the collation options- Returns:
- the collation options
- Since:
- 3.4
-
collation
Deprecated.Sets the collation optionsA null value represents the server default.
- Parameters:
collation- the collation options to use- Returns:
- this
- Since:
- 3.4
-
getMaxTime
Deprecated.Gets the maximum execution time on the server for this operation. The default is 0, which places no limit on the execution time.- Parameters:
timeUnit- the time unit to return the result in- Returns:
- the maximum execution time in the given time unit
-
maxTime
Deprecated.Sets the maximum execution time on the server for this operation.- Parameters:
maxTime- the max timetimeUnit- the time unit, which may not be null- Returns:
- this
-
execute
Deprecated.Executing this will return a cursor with your results and the statistics in.- Specified by:
executein interfaceReadOperation<T>- Parameters:
binding- the binding- Returns:
- a MapReduceCursor that can be iterated over to find all the results of the Map Reduce operation.
-
executeAsync
public void executeAsync(AsyncReadBinding binding, SingleResultCallback<MapReduceAsyncBatchCursor<T>> callback) Deprecated.Description copied from interface:AsyncReadOperationGeneral execute which can return anything of type T- Specified by:
executeAsyncin interfaceAsyncReadOperation<T>- Parameters:
binding- the binding to execute in the context ofcallback- the callback to be called when the operation has been executed
-
asExplainableOperation
Deprecated.Gets an operation whose execution explains this operation.- Parameters:
explainVerbosity- the explain verbosity- Returns:
- a read operation that when executed will explain this operation
-
asExplainableOperationAsync
public AsyncReadOperation<BsonDocument> asExplainableOperationAsync(ExplainVerbosity explainVerbosity) Deprecated.Gets an operation whose execution explains this operation.- Parameters:
explainVerbosity- the explain verbosity- Returns:
- a read operation that when executed will explain this operation
-