AggregateQueryBuilder

final case
class AggregateQueryBuilder[F[_], T] extends QueryBuilder[[TResult <: <FromJavaObject>] =>> AggregatePublisher[TResult], T]
trait Serializable
trait Product
trait Equals
trait QueryBuilder[[TResult <: <FromJavaObject>] =>> AggregatePublisher[TResult], T]
class Object
trait Matchable
class Any

Value members

Concrete methods

def all: F[Iterable[T]]
def allowDiskUse(allowDiskUse: Boolean): AggregateQueryBuilder[F, T]

Enables writing to temporary files. A null value indicates that it's unspecified.

Enables writing to temporary files. A null value indicates that it's unspecified.

Value Params
allowDiskUse

true if writing to temporary files is enabled

Returns

AggregateQueryBuilder

def batchSize(batchSize: Int): AggregateQueryBuilder[F, T]

Sets the number of documents to return per batch.

Sets the number of documents to return per batch.

Overrides the Subscription#request value for setting the batch size, allowing for fine grained control over the underlying cursor.

Value Params
batchSize

the batch size

Returns

AggregateQueryBuilder

Since

1.8

def boundedStream(capacity: Int): Stream[F, T]
def bypassDocumentValidation(bypassDocumentValidation: Boolean): AggregateQueryBuilder[F, T]

Sets the bypass document level validation flag.

Sets the bypass document level validation flag.

Note: This only applies when an $out stage is specified.

Value Params
bypassDocumentValidation

If true, allows the write to opt-out of document level validation.

Returns

AggregateQueryBuilder

Since

1.2

def collation(collation: Collation): AggregateQueryBuilder[F, T]

Sets the collation options

Sets the collation options

A null value represents the server default.

Value Params
collation

the collation options to use

Returns

AggregateQueryBuilder

Since

1.3

def comment(comment: String): AggregateQueryBuilder[F, T]

Sets the comment to the aggregation.

Sets the comment to the aggregation.

Value Params
comment

the comment

Returns

AggregateQueryBuilder

Since

1.7

Explain the execution plan for this operation with the server's default verbosity level

Explain the execution plan for this operation with the server's default verbosity level

Returns

the execution plan

Since

4.2

def explain(verbosity: ExplainVerbosity): F[Document]

Explain the execution plan for this operation with the given verbosity level

Explain the execution plan for this operation with the given verbosity level

Value Params
verbosity

the verbosity of the explanation

Returns

the execution plan

Since

4.2

def first: F[Option[T]]
def hint(hint: Bson): AggregateQueryBuilder[F, T]

Sets the hint for which index to use.

Sets the hint for which index to use.

Value Params
hint

the hint

Returns

AggregateQueryBuilder

Since

1.7

def hint(index: Index): AggregateQueryBuilder[F, T]
def let(variables: Bson): AggregateQueryBuilder[F, T]

Add top-level variables to the aggregation.

Add top-level variables to the aggregation.

For MongoDB 5.0+, the aggregate command accepts a let option. This option is a document consisting of zero or more fields representing variables that are accessible to the aggregation pipeline. The key is the name of the variable and the value is a constant in the aggregate expression language. Each parameter name is then usable to access the value of the corresponding expression with the "$$" syntax within aggregate expression contexts which may require the use of $expr or a pipeline.

Value Params
variables

the variables

Returns

AggregateQueryBuilder

Since

4.3

def maxAwaitTime(duration: Duration): AggregateQueryBuilder[F, T]

The maximum amount of time for the server to wait on new documents to satisfy a $changeStream aggregation.

The maximum amount of time for the server to wait on new documents to satisfy a $changeStream aggregation.

A zero value will be ignored.

Value Params
duration

the max await time

Returns

the maximum await execution time in the given time unit

Since

1.6

def maxTime(duration: Duration): AggregateQueryBuilder[F, T]

Sets the maximum execution time on the server for this operation.

Sets the maximum execution time on the server for this operation.

Value Params
duration

the max time

Returns

AggregateQueryBuilder

def stream: Stream[F, T]
def toCollection: F[Unit]

Aggregates documents according to the specified aggregation pipeline, which must end with a $out stage.

Aggregates documents according to the specified aggregation pipeline, which must end with a $out stage.

Returns

a unit, that indicates when the operation has completed

Inherited methods

protected
def applyCommands(): AggregatePublisher[T]
Inherited from
QueryBuilder
def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product