DATAMONGO-1550 - Add $replaceRoot aggregation stage.
We now support the $replaceRoot stage in aggregation pipelines. $replaceRoot can reference either a field, an aggregation expression or it can be used to compose a replacement document.
newAggregation(
replaceRoot().withDocument()
.andValue("value").as("field")
.and(MULTIPLY.of(field("total"), field("discounted")))
);
newAggregation(
replaceRoot("item")));
Original Pull Request: #422
This commit is contained in:
committed by
Christoph Strobl
parent
1dea009e32
commit
ae4cfaa58c
@@ -1676,7 +1676,7 @@ At the time of this writing we provide support for the following Aggregation Ope
|
||||
[cols="2*"]
|
||||
|===
|
||||
| Pipeline Aggregation Operators
|
||||
| project, skip, limit, lookup, unwind, group, sort, geoNear
|
||||
| count, geoNear, group, limit, lookup, match, project, replaceRoot, skip, sort, unwind
|
||||
|
||||
| Set Aggregation Operators
|
||||
| setEquals, setIntersection, setUnion, setDifference, setIsSubset, anyElementTrue, allElementsTrue
|
||||
|
||||
Reference in New Issue
Block a user