Open
Description
Feature Request
Q | A |
---|---|
New Feature | yes |
RFC | no |
BC Break | no |
Summary
With MongoDB 4.2 and version 1.5 of the MongoDB library, it is possible to pass an aggregation pipeline to update operations (findAndModify
, update
, updates in bulk writes). This should be leveraged in the query builder by integrating a subset of aggregation features.
Possible syntax:
$queryBuilder
->field('field')
->equals('value')
->updateOne()
->pipeline()
->addFields() // or its alias $set
->project() // or its alias $unset
->replaceRoot() // or its alias $replaceWith
->end()
Other pipeline stages should not be available as they would create a query error.