Package com.mongodb

Class MapReduceCommand


  • @Deprecated(since="2021-05-27")
    public class MapReduceCommand
    extends java.lang.Object
    Deprecated.
    Usage of this API is not supported in AEM as a Cloud Service.
    This class groups the argument for a map/reduce operation and can build the underlying command object
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  MapReduceCommand.OutputType
      Deprecated.
      Represents the different options available for outputting the results of a map-reduce operation.
    • Constructor Summary

      Constructors 
      Constructor Description
      MapReduceCommand​(DBCollection inputCollection, java.lang.String map, java.lang.String reduce, java.lang.String outputCollection, MapReduceCommand.OutputType type, DBObject query)
      Deprecated.
      Represents the command for a map reduce operation Runs the command in REPLACE output type to a named collection
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      java.lang.Boolean getBypassDocumentValidation()
      Deprecated.
      Gets whether to bypass document validation, or null if unspecified.
      Collation getCollation()
      Deprecated.
      Returns the collation
      java.lang.String getFinalize()
      Deprecated.
      Gets the Finalize JS Function
      java.lang.String getInput()
      Deprecated.
      Get the name of the collection the MapReduce will read from
      java.lang.Boolean getJsMode()
      Deprecated.
      Gets the (optional) JavaScript mode
      int getLimit()
      Deprecated.
      Gets the (optional) limit on input
      java.lang.String getMap()
      Deprecated.
      Get the map function, as a JS String
      long getMaxTime​(java.util.concurrent.TimeUnit timeUnit)
      Deprecated.
      Gets the max execution time for this command, in the given time unit.
      java.lang.String getOutputDB()
      Deprecated.
      Gets the (optional) database name where the output collection should reside
      java.lang.String getOutputTarget()
      Deprecated.
      Gets the output target (name of collection to save to) This value is nullable only if OutputType is set to INLINE
      MapReduceCommand.OutputType getOutputType()
      Deprecated.
      Gets the OutputType for this instance.
      DBObject getQuery()
      Deprecated.
      Gets the query to run for this MapReduce job
      ReadPreference getReadPreference()
      Deprecated.
      Gets the read preference
      java.lang.String getReduce()
      Deprecated.
      Gets the reduce function, as a JS String
      java.util.Map<java.lang.String,​java.lang.Object> getScope()
      Deprecated.
      Gets the (optional) JavaScript scope
      DBObject getSort()
      Deprecated.
      Gets the (optional) sort specification object
      java.lang.Boolean isVerbose()
      Deprecated.
      Gets the verbosity of the MapReduce job.
      void setBypassDocumentValidation​(java.lang.Boolean bypassDocumentValidation)
      Deprecated.
      Sets whether to bypass document validation.
      void setCollation​(Collation collation)
      Deprecated.
      Sets the collation options
      void setFinalize​(java.lang.String finalize)
      Deprecated.
      Sets the Finalize JS Function
      void setJsMode​(java.lang.Boolean jsMode)
      Deprecated.
      Sets the (optional) JavaScript Mode
      void setLimit​(int limit)
      Deprecated.
      Sets the (optional) limit on input
      void setMaxTime​(long maxTime, java.util.concurrent.TimeUnit timeUnit)
      Deprecated.
      Sets the max execution time for this command, in the given time unit.
      void setOutputDB​(java.lang.String outputDB)
      Deprecated.
      Sets the (optional) database name where the output collection should reside
      void setReadPreference​(ReadPreference preference)
      Deprecated.
      Sets the read preference for this command.
      void setScope​(java.util.Map<java.lang.String,​java.lang.Object> scope)
      Deprecated.
      Sets the (optional) JavaScript scope
      void setSort​(DBObject sort)
      Deprecated.
      Sets the (optional) sort specification object
      void setVerbose​(java.lang.Boolean verbose)
      Deprecated.
      Sets the verbosity of the MapReduce job, defaults to 'true'
      DBObject toDBObject()
      Deprecated.
      Turns this command into a DBObject representation of this map reduce command.
      java.lang.String toString()
      Deprecated.
       
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MapReduceCommand

        public MapReduceCommand​(DBCollection inputCollection,
                                java.lang.String map,
                                java.lang.String reduce,
                                @Nullable
                                java.lang.String outputCollection,
                                MapReduceCommand.OutputType type,
                                DBObject query)
        Deprecated.
        Represents the command for a map reduce operation Runs the command in REPLACE output type to a named collection
        Parameters:
        inputCollection - collection to use as the source documents to perform the map reduce operation.
        map - a JavaScript function that associates or "maps" a value with a key and emits the key and value pair.
        reduce - a JavaScript function that "reduces" to a single object all the values associated with a particular key.
        outputCollection - optional - leave null if want to get the result inline
        type - the type of output
        query - specifies the selection criteria using query operators for determining the documents input to the map function.
    • Method Detail

      • setVerbose

        public void setVerbose​(java.lang.Boolean verbose)
        Deprecated.
        Sets the verbosity of the MapReduce job, defaults to 'true'
        Parameters:
        verbose - The verbosity level.
      • isVerbose

        public java.lang.Boolean isVerbose()
        Deprecated.
        Gets the verbosity of the MapReduce job.
        Returns:
        the verbosity level.
      • getInput

        public java.lang.String getInput()
        Deprecated.
        Get the name of the collection the MapReduce will read from
        Returns:
        name of the collection the MapReduce will read from
      • getMap

        public java.lang.String getMap()
        Deprecated.
        Get the map function, as a JS String
        Returns:
        the map function (as a JS String)
      • getReduce

        public java.lang.String getReduce()
        Deprecated.
        Gets the reduce function, as a JS String
        Returns:
        the reduce function (as a JS String)
      • getOutputTarget

        @Nullable
        public java.lang.String getOutputTarget()
        Deprecated.
        Gets the output target (name of collection to save to) This value is nullable only if OutputType is set to INLINE
        Returns:
        The outputCollection
      • getOutputType

        public MapReduceCommand.OutputType getOutputType()
        Deprecated.
        Gets the OutputType for this instance.
        Returns:
        The outputType.
      • getFinalize

        @Nullable
        public java.lang.String getFinalize()
        Deprecated.
        Gets the Finalize JS Function
        Returns:
        The finalize function (as a JS String).
      • setFinalize

        public void setFinalize​(@Nullable
                                java.lang.String finalize)
        Deprecated.
        Sets the Finalize JS Function
        Parameters:
        finalize - The finalize function (as a JS String)
      • getQuery

        @Nullable
        public DBObject getQuery()
        Deprecated.
        Gets the query to run for this MapReduce job
        Returns:
        The query object
      • getSort

        @Nullable
        public DBObject getSort()
        Deprecated.
        Gets the (optional) sort specification object
        Returns:
        the Sort DBObject
      • setSort

        public void setSort​(@Nullable
                            DBObject sort)
        Deprecated.
        Sets the (optional) sort specification object
        Parameters:
        sort - The sort specification object
      • getLimit

        public int getLimit()
        Deprecated.
        Gets the (optional) limit on input
        Returns:
        The limit specification object
      • setLimit

        public void setLimit​(int limit)
        Deprecated.
        Sets the (optional) limit on input
        Parameters:
        limit - The limit specification object
      • getMaxTime

        public long getMaxTime​(java.util.concurrent.TimeUnit timeUnit)
        Deprecated.
        Gets the max execution time for this command, in the given time unit.
        Parameters:
        timeUnit - the time unit to return the value in.
        Returns:
        the maximum execution time
        Since:
        2.12.0
      • setMaxTime

        public void setMaxTime​(long maxTime,
                               java.util.concurrent.TimeUnit timeUnit)
        Deprecated.
        Sets the max execution time for this command, in the given time unit.
        Parameters:
        maxTime - the maximum execution time. A non-zero value requires a server version >= 2.6
        timeUnit - the time unit that maxTime is specified in
        Since:
        2.12.0
      • getScope

        @Nullable
        public java.util.Map<java.lang.String,​java.lang.Object> getScope()
        Deprecated.
        Gets the (optional) JavaScript scope
        Returns:
        The JavaScript scope
      • setScope

        public void setScope​(@Nullable
                             java.util.Map<java.lang.String,​java.lang.Object> scope)
        Deprecated.
        Sets the (optional) JavaScript scope
        Parameters:
        scope - The JavaScript scope
      • getJsMode

        @Nullable
        public java.lang.Boolean getJsMode()
        Deprecated.
        Gets the (optional) JavaScript mode
        Returns:
        The JavaScript mode
        Since:
        2.13
      • setJsMode

        public void setJsMode​(@Nullable
                              java.lang.Boolean jsMode)
        Deprecated.
        Sets the (optional) JavaScript Mode
        Parameters:
        jsMode - Specifies whether to convert intermediate data into BSON format between the execution of the map and reduce functions
        Since:
        2.13
      • getOutputDB

        @Nullable
        public java.lang.String getOutputDB()
        Deprecated.
        Gets the (optional) database name where the output collection should reside
        Returns:
        the name of the database the result is stored in, or null.
      • setOutputDB

        public void setOutputDB​(@Nullable
                                java.lang.String outputDB)
        Deprecated.
        Sets the (optional) database name where the output collection should reside
        Parameters:
        outputDB - the name of the database to send the Map Reduce output to
      • getBypassDocumentValidation

        @Nullable
        public java.lang.Boolean getBypassDocumentValidation()
        Deprecated.
        Gets whether to bypass document validation, or null if unspecified. The default is null.
        Returns:
        whether to bypass document validation, or null if unspecified.
        Since:
        2.14
      • setBypassDocumentValidation

        public void setBypassDocumentValidation​(@Nullable
                                                java.lang.Boolean bypassDocumentValidation)
        Deprecated.
        Sets whether to bypass document validation.
        Parameters:
        bypassDocumentValidation - whether to bypass document validation, or null if unspecified
        Since:
        2.14
      • toDBObject

        public DBObject toDBObject()
        Deprecated.
        Turns this command into a DBObject representation of this map reduce command.
        Returns:
        a DBObject that contains the MongoDB document representation of this command.
      • setReadPreference

        public void setReadPreference​(@Nullable
                                      ReadPreference preference)
        Deprecated.
        Sets the read preference for this command. See the * documentation for ReadPreference for more information.
        Parameters:
        preference - Read Preference to use
      • getReadPreference

        @Nullable
        public ReadPreference getReadPreference()
        Deprecated.
        Gets the read preference
        Returns:
        the readPreference
      • getCollation

        @Nullable
        public Collation getCollation()
        Deprecated.
        Returns the collation
        Returns:
        the collation
        Since:
        3.4
      • setCollation

        @Nullable
        public void setCollation​(Collation collation)
        Deprecated.
        Sets the collation options
        Parameters:
        collation - the collation options
        Since:
        3.4
      • toString

        public java.lang.String toString()
        Deprecated.
        Overrides:
        toString in class java.lang.Object