Native Aggregation
Describes how to execute the Bson aggregation stage of the MongoDB Driver from the first stage without reimplementing new Driver features in DSL.
Driver-native root aggregation
aggregation() executes the Bson stages returned by the MongoDB Driver in the order they are called from the first stage. The DSL does not reimplement Driver aggregation operators but handles pipeline execution, mapping, Reactor publisher, and preview/explain connections. Document can also be passed directly as it is Bson.
Result mapping
execute()
Maps the result to the source entity type.
execute(ResultType.class)
Maps to a separate result type when the shape of the aggregation result differs from the source entity.
executeDocument()
Returns the raw MongoDB Document as is.
$score / $scoreFusion of MongoDB Driver 5.10
1.0.0 does not create a dedicated wrapper for $score and $scoreFusion. Since Driver 5.10's Aggregates.score(...) / Aggregates.scoreFusion(...) already returns a Bson stage, it is passed directly to stage(...).
Add Bson stage after Search / Vector
The stage(Bson) of Search/Vector comes immediately after the mandatory first stage $search/$vectorSearch. Features that require the stage itself to be the first in the pipeline use aggregation().
Aggregation publisher options
preview() and actual MongoDB explain() are also supported in the root aggregation builder.