-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Optimization
-
None
-
None
-
None
-
None
-
None
-
None
-
None
If an update command is a replacement update, arrayFilters are ignored during execution of the command. The fact that arrayFilters are not used in execution indicates that we should invalidate such an update request.
For example, the following command should have resulted in a parsing error
db.runCommand({
update: "coll",
updates: [
{
q: {a: 1},
u: {a: 1, b: "new"}, // replacement update
arrayFilters: [ {"x.y.z": { $eq: 10 } }]
}
]
})
Fixing this behavior also helps query shapification. Because we would not want to include arrayFilters in the query shape if an update op is a replacement update.