Skip to content

Commit c794aca

Browse files
Cover missing Aggregation Stages in reference documentation.
Closes: #3938
1 parent 339db9d commit c794aca

File tree

1 file changed

+52
-28
lines changed

1 file changed

+52
-28
lines changed

src/main/asciidoc/reference/aggregation-framework.adoc

Lines changed: 52 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,58 @@ List<OutputType> mappedResult = results.getMappedResults();
5252
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.
5353

5454
[[mongo.aggregation.supported-aggregation-operations]]
55-
=== Supported Aggregation Operations
55+
=== Supported Aggregation Operations & Stages
56+
57+
The MongoDB Aggregation Framework provides the following types of aggregation stages and operations:
58+
59+
==== Aggregation Stages
60+
61+
* addFields - `AddFieldsOperation`
62+
* bucket / bucketAuto - `BucketOperation` / `BucketAutoOperation`
63+
* count - `CountOperation`
64+
* densify - `DensifyOperation`
65+
* facet - `FacetOperation`
66+
* geoNear - `GeoNearOperation`
67+
* graphLookup - `GraphLookupOperation`
68+
* group - `GroupOperation`
69+
* limit - `LimitOperation`
70+
* lookup - `LookupOperation`
71+
* match - `MatchOperation`
72+
* merge - `MergeOperation`
73+
* project - `ProjectionOperation`
74+
* redact - `RedactOperation`
75+
* replaceRoot - `ReplaceRootOperation`
76+
* sample - `SampleOperation`
77+
* set - `SetOperation`
78+
* setWindowFields - `SetWindowFieldsOperation`
79+
* skip - `SkipOperation`
80+
* sort / sortByCount - `SortOperation` / `SortByCountOperation`
81+
* unionWith - `UnionWithOperation`
82+
* unset - `UnsetOperation`
83+
* unwind - `UnwindOperation`
5684

57-
The MongoDB Aggregation Framework provides the following types of aggregation operations:
85+
[TIP]
86+
====
87+
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`.
88+
`Aggregation.stage` is a shortcut for registering a pipeline stage by providing its JSON or `Bson` representation.
89+
90+
[source,java]
91+
----
92+
Aggregation.stage("""
93+
{ $search : {
94+
"near": {
95+
"path": "released",
96+
"origin": { "$date": { "$numberLong": "..." } } ,
97+
"pivot": 7
98+
}
99+
}
100+
}
101+
""");
102+
----
103+
====
104+
105+
==== Aggregation Operators
58106

59-
* Pipeline Aggregation Operators
60107
* Group/Accumulator Aggregation Operators
61108
* Boolean Aggregation Operators
62109
* Comparison Aggregation Operators
@@ -70,14 +117,11 @@ The MongoDB Aggregation Framework provides the following types of aggregation op
70117
* Object Aggregation Operators
71118
* Script Aggregation Operators
72119

73-
At the time of this writing, we provide support for the following Aggregation Operations in Spring Data MongoDB:
120+
At the time of this writing, we provide support for the following Aggregation Operators in Spring Data MongoDB:
74121

75-
.Aggregation Operations currently supported by Spring Data MongoDB
122+
.Aggregation Operators currently supported by Spring Data MongoDB
76123
[cols="2*"]
77124
|===
78-
| Pipeline Aggregation Operators
79-
| `bucket`, `bucketAuto`, `count`, `facet`, `geoNear`, `graphLookup`, `group`, `limit`, `lookup`, `match`, `project`, `rand`, `replaceRoot`, `skip`, `sort`, `unwind`
80-
81125
| Set Aggregation Operators
82126
| `setEquals`, `setIntersection`, `setUnion`, `setDifference`, `setIsSubset`, `anyElementTrue`, `allElementsTrue`
83127

@@ -126,26 +170,6 @@ At the time of this writing, we provide support for the following Aggregation Op
126170

127171
Note that the aggregation operations not listed here are currently not supported by Spring Data MongoDB. Comparison aggregation operators are expressed as `Criteria` expressions.
128172

129-
[TIP]
130-
====
131-
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`.
132-
`Aggregation.stage` is a shortcut for registering a pipeline stage by providing its JSON or `Bson` representation.
133-
134-
[source,java]
135-
----
136-
Aggregation.stage("""
137-
{ $search : {
138-
"near": {
139-
"path": "released",
140-
"origin": { "$date": { "$numberLong": "..." } } ,
141-
"pivot": 7
142-
}
143-
}
144-
}
145-
""");
146-
----
147-
====
148-
149173
[[mongo.aggregation.projection]]
150174
=== Projection Expressions
151175

0 commit comments

Comments
 (0)