Summary
An empty pipeline array is a NOP for both update and findAndModify. The current CRUD spec tests for update pipelines only use non-empty pipeline arrays. We should test this to assert that drivers don't prohibit users from specifying an empty array (despite there being little reason to do so).
Consider:
> db.runCommand({ update: "foo", updates: [ { q: { _id: 1 }, u: [] } ] })
|
|
> db.runCommand({ findAndModify: "foo", query: { _id: 1 }, update: [] })
|
Motivation
Who is the affected end user?
Users wishing to execute NOP pipelines.
How does this affect the end user?
Users are potentially blocked if a driver happens to reject an empty pipeline.
How likely is it that this problem or use case will occur?
Very rare.
If the problem does occur, what are the consequences and how severe are they?
Drivers may potentially reject a valid pipeline argument.
Is this issue urgent?
No.
Is this ticket required by a downstream team?
No.
Is this ticket only for tests?
Yes.