[DRIVERS-2081] Clarify usage of aggregation pipeline in CRUD spec Created: 26/Aug/19 Updated: 31/Mar/22 |
|
| Status: | Backlog |
| Project: | Drivers |
| Component/s: | CRUD |
| Fix Version/s: | None |
| Type: | Spec Change | Priority: | Major - P3 |
| Reporter: | Andreas Braun | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Driver Changes: | Needed | ||||
| Description |
|
As noted by jmikola in https://github.com/mongodb/mongo-php-library/pull/670#discussion_r317378293, the CRUD spec does not specify any expected driver behaviour when a user passes an aggregation pipeline as update option to a replace operation. The spec should clarify this and also add spec tests covering the expected behaviour. |
| Comments |
| Comment by Jeremy Mikola [ 27/Aug/19 ] |
|
Furthermore, drivers such as C and PHP reject empty arrays for update pipelines. Per my analysis in https://github.com/mongodb/mongo-php-library/pull/670#discussion_r317378507, the server actually accepts this and interprets it as a NOP. I don't think there is a problem with drivers rejecting such values, but we'd do well to codify this in the spec one way or the other. FWIW, I believe all drivers allow empty pipelines for aggregate, but that's not directly comparable as an empty pipeline there is effectively an unfiltered find query. In that sense, aggregate still does something, as opposed to a NOP-ing update. |