Extend update command to perform per-operation validation

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Won't Do
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Write Ops
    • Query
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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 } }
         ]}
      });
      

            Assignee:
            Backlog - Query Team (Inactive)
            Reporter:
            Michael O'Brien
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: