Note that, if you provide an input class as the first parameter to the `newAggregation` method, the `MongoTemplate` derives the name of the input collection from this class. Otherwise, if you do not not specify an input class, you must provide the name of the input collection explicitly. If both an input class and an input collection are provided, the latter takes precedence.
The MongoDB Aggregation Framework provides the following types of aggregation operations:
[TIP]
====
Unsupported aggregation stages (like https://www.mongodb.com/docs/atlas/atlas-search/query-syntax/[$search] for MongoDB Atlas) can be provided by implementing either `AggregationOperation`.
`Aggregation.stage` is a shortcut for registering a pipeline stage by providing its JSON or `Bson` representation.
[source,java]
----
Aggregation.stage("""
{ $search : {
"near": {
"path": "released",
"origin": { "$date": { "$numberLong": "..." } } ,
"pivot": 7
}
}
}
""");
----
====
==== Aggregation Operators
* Pipeline Aggregation Operators
* Group/Accumulator Aggregation Operators
* Boolean Aggregation Operators
* Comparison Aggregation Operators
@ -70,14 +117,11 @@ The MongoDB Aggregation Framework provides the following types of aggregation op
@@ -70,14 +117,11 @@ The MongoDB Aggregation Framework provides the following types of aggregation op
* Object Aggregation Operators
* Script Aggregation Operators
At the time of this writing, we provide support for the following Aggregation Operations in Spring Data MongoDB:
At the time of this writing, we provide support for the following Aggregation Operators in Spring Data MongoDB:
.Aggregation Operations currently supported by Spring Data MongoDB
.Aggregation Operators currently supported by Spring Data MongoDB
@ -126,26 +170,6 @@ At the time of this writing, we provide support for the following Aggregation Op
@@ -126,26 +170,6 @@ At the time of this writing, we provide support for the following Aggregation Op
Note that the aggregation operations not listed here are currently not supported by Spring Data MongoDB. Comparison aggregation operators are expressed as `Criteria` expressions.
[TIP]
====
Unsupported aggregation operations/operators (like https://www.mongodb.com/docs/atlas/atlas-search/query-syntax/[$search] for MongoDB Atlas) can be provided by implementing either `AggregationOperation` or `AggregationExpression`.
`Aggregation.stage` is a shortcut for registering a pipeline stage by providing its JSON or `Bson` representation.