Enum Class MapReduceAction

java.lang.Object
java.lang.Enum<MapReduceAction>
com.mongodb.client.model.MapReduceAction
All Implemented Interfaces:
Serializable, Comparable<MapReduceAction>, java.lang.constant.Constable

@Deprecated public enum MapReduceAction extends Enum<MapReduceAction>
Deprecated.
Superseded by aggregate
The map reduce to collection actions.

These actions are only available when passing out a collection that already exists. This option is not available on secondary members of replica sets. The Enum values dictate what to do with the output collection if it already exists when the map reduce is run.

Since:
3.0
MongoDB documentation
mapReduce Command
mapReduce Overview
  • Enum Constant Details

    • REPLACE

      public static final MapReduceAction REPLACE
      Deprecated.
      Replace the contents of the collectionName if the collection with the collectionName exists.
    • MERGE

      public static final MapReduceAction MERGE
      Deprecated.
      Merge the new result with the existing result if the output collection already exists. If an existing document has the same key as the new result, overwrite that existing document.
    • REDUCE

      public static final MapReduceAction REDUCE
      Deprecated.
      Merge the new result with the existing result if the output collection already exists. If an existing document has the same key as the new result, apply the reduce function to both the new and the existing documents and overwrite the existing document with the result.
  • Method Details

    • values

      public static MapReduceAction[] values()
      Deprecated.
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MapReduceAction valueOf(String name)
      Deprecated.
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public String getValue()
      Deprecated.
      Returns:
      the String representation of this Action that the MongoDB server understands