Class MapReduceOptions

java.lang.Object
org.springframework.data.mongodb.core.mapreduce.MapReduceOptions

@Deprecated public class MapReduceOptions extends Object
Deprecated.
Author:
Mark Pollack, Oliver Gierke, Christoph Strobl, Mark Paluch
  • Constructor Details

    • MapReduceOptions

      public MapReduceOptions()
      Deprecated.
  • Method Details

    • options

      public static MapReduceOptions options()
      Deprecated.
      Static factory method to create a MapReduceOptions instance
      Returns:
      a new instance
    • limit

      public MapReduceOptions limit(int limit)
      Deprecated.
      Limit the number of objects to return from the collection that is fed into the map reduce operation Often used in conjunction with a query and sort option so as to reduce the portion of the data that will be processed.
      Parameters:
      limit - Limit the number of objects to process
      Returns:
      MapReduceOptions so that methods can be chained in a fluent API style
    • outputCollection

      public MapReduceOptions outputCollection(String collectionName)
      Deprecated.
      The collection where the results from the map-reduce operation will be stored. Note, you can set the database name as well with the outputDatabase option.
      Parameters:
      collectionName - The name of the collection where the results of the map-reduce operation will be stored.
      Returns:
      MapReduceOptions so that methods can be chained in a fluent API style
    • outputDatabase

      public MapReduceOptions outputDatabase(@Nullable String outputDatabase)
      Deprecated.
      The database where the results from the map-reduce operation will be stored. Note, you ca set the collection name as well with the outputCollection option.
      Parameters:
      outputDatabase - The name of the database where the results of the map-reduce operation will be stored.
      Returns:
      MapReduceOptions so that methods can be chained in a fluent API style
    • actionInline

      public MapReduceOptions actionInline()
      Deprecated.
      With this option, no collection will be created, and the whole map-reduce operation will happen in RAM. Also, the results of the map-reduce will be returned within the result object. Note that this option is possible only when the result set fits within the 16MB limit of a single document.
      Returns:
      this.
      Since:
      3.0
    • actionMerge

      public MapReduceOptions actionMerge()
      Deprecated.
      This option will merge new data into the old output collection. In other words, if the same key exists in both the result set and the old collection, the new key will overwrite the old one.
      Returns:
      this.
      Since:
      3.0
    • actionReduce

      public MapReduceOptions actionReduce()
      Deprecated.
      If documents exists for a given key in the result set and in the old collection, then a reduce operation (using the specified reduce function) will be performed on the two values and the result will be written to the output collection. If a finalize function was provided, this will be run after the reduce as well.
      Returns:
      this.
      Since:
      3.0
    • actionReplace

      public MapReduceOptions actionReplace()
      Deprecated.
      The output will be inserted into a collection which will atomically replace any existing collection with the same name. Note, the default is MapReduceAction.REPLACE.
      Returns:
      MapReduceOptions so that methods can be chained in a fluent API style
      Since:
      3.0
    • outputSharded

      public MapReduceOptions outputSharded(boolean outputShared)
      Deprecated.
      If true and combined with an output mode that writes to a collection, the output collection will be sharded using the _id field. For MongoDB 1.9+
      Parameters:
      outputShared - if true, output will be sharded based on _id key.
      Returns:
      MapReduceOptions so that methods can be chained in a fluent API style
    • finalizeFunction

      public MapReduceOptions finalizeFunction(@Nullable String finalizeFunction)
      Deprecated.
      Sets the finalize function
      Parameters:
      finalizeFunction - The finalize function. Can be a JSON string or a Spring Resource URL
      Returns:
      MapReduceOptions so that methods can be chained in a fluent API style
    • scopeVariables

      public MapReduceOptions scopeVariables(Map<String,Object> scopeVariables)
      Deprecated.
      Key-value pairs that are placed into JavaScript global scope and can be accessed from map, reduce, and finalize scripts.
      Parameters:
      scopeVariables - variables that can be accessed from map, reduce, and finalize scripts
      Returns:
      MapReduceOptions so that methods can be chained in a fluent API style
    • javaScriptMode

      public MapReduceOptions javaScriptMode(boolean javaScriptMode)
      Deprecated.
      Flag that toggles behavior in the map-reduce operation so as to avoid intermediate conversion to BSON between the map and reduce steps. For MongoDB 1.9+
      Parameters:
      javaScriptMode - if true, have the execution of map-reduce stay in JavaScript
      Returns:
      MapReduceOptions so that methods can be chained in a fluent API style
    • verbose

      public MapReduceOptions verbose(boolean verbose)
      Deprecated.
      Flag to set that will provide statistics on job execution time.
      Returns:
      MapReduceOptions so that methods can be chained in a fluent API style
    • collation

      public MapReduceOptions collation(@Nullable Collation collation)
      Deprecated.
      Define the Collation specifying language-specific rules for string comparison.
      Parameters:
      collation - can be null.
      Returns:
      Since:
      2.0
    • getFinalizeFunction

      public Optional<String> getFinalizeFunction()
      Deprecated.
    • getJavaScriptMode

      @Nullable public Boolean getJavaScriptMode()
      Deprecated.
    • getOutputCollection

      @Nullable public String getOutputCollection()
      Deprecated.
    • getOutputDatabase

      public Optional<String> getOutputDatabase()
      Deprecated.
    • getOutputSharded

      public Optional<Boolean> getOutputSharded()
      Deprecated.
    • getScopeVariables

      public Map<String,Object> getScopeVariables()
      Deprecated.
    • getLimit

      @Nullable public Integer getLimit()
      Deprecated.
      Get the maximum number of documents for the input into the map function.
      Returns:
      null if not set.
    • getCollation

      public Optional<Collation> getCollation()
      Deprecated.
      Get the Collation specifying language-specific rules for string comparison.
      Returns:
      Since:
      2.0
    • getMapReduceAction

      @Nullable public com.mongodb.client.model.MapReduceAction getMapReduceAction()
      Deprecated.
      Return the MapReduceAction.
      Returns:
      the mapped action or null if the action maps to inline output.
      Since:
      2.0.10
    • usesInlineOutput

      public boolean usesInlineOutput()
      Deprecated.
      Returns:
      true if inline output is used.
      Since:
      2.0.10
    • getOptionsObject

      public org.bson.Document getOptionsObject()
      Deprecated.
    • createOutObject

      protected org.bson.Document createOutObject()
      Deprecated.