-
Type:
Improvement
-
Resolution: Done
-
Priority:
Minor - P4
-
Affects Version/s: 2.2.22
-
Component/s: MongoDB 3.4
MongoDB 3.4+ supports a $replaceRoot stage while aggregating: https://docs.mongodb.com/manual/reference/operator/aggregation/replaceRoot/#pipe._S_replaceRoot
`lib/aggregation_cursor.js` seems to define prototype / class methods for method chaining instead of using an array/object-based raw pipeline. `.replaceRoot(
{ newRoot: '$xyz' })` isn't available there yet and I'd like to add it to make our code (which uses chaining elsewhere) consistent.
I would be happy to submit a pull request for this, the only thing I was unsure about was how to limit the command to servers of version 3.4+ only, and whether this is necessary. Can someone advise me on this?