-
Type: New Feature
-
Resolution: Won't Do
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Write Ops
-
Query
Currently all validation settings exist in collection options, so they apply to all updates and inserts collection-wide.
It would be useful to have the ability to specify a validation condition per-op, so that rules that have parameters based on the context of the op can be used as part of the validation rule.
There is no way to do this client side, because the client can not know the result of applying the update modifiers.
example:
db.runCommand({"update", {updates: [ q: { user: "bobby.tables" }, u: { $inc: {score:100} } , upsert : false, multi: true, validator: { score: {$lt: team.score_limit } } ]} });