Class AggregateOperation<T>

    • Constructor Detail

      • AggregateOperation

        public AggregateOperation​(MongoNamespace namespace,
                                  java.util.List<BsonDocument> pipeline,
                                  Decoder<T> decoder)
        Deprecated.
        Construct a new instance.
        Parameters:
        namespace - the database and collection namespace for the operation.
        pipeline - the aggregation pipeline.
        decoder - the decoder for the result documents.
      • AggregateOperation

        public AggregateOperation​(MongoNamespace namespace,
                                  java.util.List<BsonDocument> pipeline,
                                  Decoder<T> decoder,
                                  AggregationLevel aggregationLevel)
        Deprecated.
        Construct a new instance.
        Parameters:
        namespace - the database and collection namespace for the operation.
        pipeline - the aggregation pipeline.
        decoder - the decoder for the result documents.
        aggregationLevel - the aggregation level
        Since:
        3.10
    • Method Detail

      • getPipeline

        public java.util.List<BsonDocument> getPipeline()
        Deprecated.
        Gets the aggregation pipeline.
        Returns:
        the pipeline
      • getAllowDiskUse

        public java.lang.Boolean getAllowDiskUse()
        Deprecated.
        Whether writing to temporary files is enabled. A null value indicates that it's unspecified.
        Returns:
        true if writing to temporary files is enabled
      • allowDiskUse

        public AggregateOperation<T> allowDiskUse​(java.lang.Boolean allowDiskUse)
        Deprecated.
        Enables writing to temporary files. A null value indicates that it's unspecified.
        Parameters:
        allowDiskUse - true if writing to temporary files is enabled
        Returns:
        this
      • getBatchSize

        public java.lang.Integer getBatchSize()
        Deprecated.
        Gets the number of documents to return per batch. Default to 0, which indicates that the server chooses an appropriate batch size.
        Returns:
        the batch size, which may be null
      • batchSize

        public AggregateOperation<T> batchSize​(java.lang.Integer batchSize)
        Deprecated.
        Sets the number of documents to return per batch.
        Parameters:
        batchSize - the batch size
        Returns:
        this
      • getMaxAwaitTime

        public long getMaxAwaitTime​(java.util.concurrent.TimeUnit timeUnit)
        Deprecated.
        The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query. This only applies to a TAILABLE_AWAIT cursor. When the cursor is not a TAILABLE_AWAIT cursor, this option is ignored. A zero value will be ignored.
        Parameters:
        timeUnit - the time unit to return the result in
        Returns:
        the maximum await execution time in the given time unit
      • maxAwaitTime

        public AggregateOperation<T> maxAwaitTime​(long maxAwaitTime,
                                                  java.util.concurrent.TimeUnit timeUnit)
        Deprecated.
        Sets the maximum await execution time on the server for this operation.
        Parameters:
        maxAwaitTime - the max await time. A value less than one will be ignored, and indicates that the driver should respect the server's default value
        timeUnit - the time unit, which may not be null
        Returns:
        this
      • getMaxTime

        public long getMaxTime​(java.util.concurrent.TimeUnit timeUnit)
        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

        public AggregateOperation<T> maxTime​(long maxTime,
                                             java.util.concurrent.TimeUnit timeUnit)
        Deprecated.
        Sets the maximum execution time on the server for this operation.
        Parameters:
        maxTime - the max time
        timeUnit - the time unit, which may not be null
        Returns:
        this
      • getUseCursor

        @Deprecated
        public java.lang.Boolean getUseCursor()
        Deprecated.
        There is no replacement for this. Applications can assume that the driver will use a cursor for server versions that support it (>= 2.6). The driver will ignore this as of MongoDB 3.6, which does not support inline results for the aggregate command.
        Gets whether the server should use a cursor to return results. The default value is null, in which case a cursor will be used if the server supports it.
        Returns:
        whether the server should use a cursor to return results
      • useCursor

        @Deprecated
        public AggregateOperation<T> useCursor​(java.lang.Boolean useCursor)
        Deprecated.
        There is no replacement for this. Applications can assume that the driver will use a cursor for server versions that support it (>= 2.6). The driver will ignore this as of MongoDB 3.6, which does not support inline results for the aggregate command.
        Sets whether the server should use a cursor to return results.
        Parameters:
        useCursor - whether the server should use a cursor to return results
        Returns:
        this
      • getCollation

        public Collation getCollation()
        Deprecated.
        Returns the collation options
        Returns:
        the collation options
        Since:
        3.4
      • collation

        public AggregateOperation<T> collation​(Collation collation)
        Deprecated.
        Sets the collation options

        A null value represents the server default.

        Parameters:
        collation - the collation options to use
        Returns:
        this
        Since:
        3.4
      • getComment

        public java.lang.String getComment()
        Deprecated.
        Returns the comment to send with the aggregate. The default is not to include a comment with the aggregation.
        Returns:
        the comment
        Since:
        3.6
      • comment

        public AggregateOperation<T> comment​(java.lang.String comment)
        Deprecated.
        Sets the comment to the aggregation. A null value means no comment is set.
        Parameters:
        comment - the comment
        Returns:
        this
        Since:
        3.6
      • retryReads

        public AggregateOperation<T> retryReads​(boolean retryReads)
        Deprecated.
        Enables retryable reads if a read fails due to a network error.
        Parameters:
        retryReads - true if reads should be retried
        Returns:
        this
        Since:
        3.11
      • getRetryReads

        public boolean getRetryReads()
        Deprecated.
        Gets the value for retryable reads. The default is true.
        Returns:
        the retryable reads value
        Since:
        3.11
      • getHint

        public BsonDocument getHint()
        Deprecated.
        Returns the hint for which index to use. The default is not to set a hint.
        Returns:
        the hint
        Since:
        3.6
      • getHintBsonValue

        public BsonValue getHintBsonValue()
        Deprecated.
        Returns the hint BsonValue for which index to use. The default is not to set a hint.

        Hints can either be a BsonString or a BsonDocument.

        Returns:
        the hint
        Since:
        3.8
      • hint

        public AggregateOperation<T> hint​(BsonValue hint)
        Deprecated.
        Sets the hint for which index to use. A null value means no hint is set.
        Parameters:
        hint - the hint
        Returns:
        this
        Since:
        3.6
      • execute

        public BatchCursor<T> execute​(ReadBinding binding)
        Deprecated.
        Description copied from interface: ReadOperation
        General execute which can return anything of type T
        Specified by:
        execute in interface ReadOperation<T>
        Parameters:
        binding - the binding to execute in the context of
        Returns:
        T, the result of the execution
      • asExplainableOperation

        public ReadOperation<BsonDocument> asExplainableOperation​(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
      • 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
      • toString

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