Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-9458

Docs for SERVER-25685: Extend update command to perform per-operation validation

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Gone away
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None

    Description

      Engineering Ticket Description:

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

      Attachments

        Activity

          People

            allison.moore@mongodb.com Allison Reinheimer Moore
            emily.hall Emily Hall
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              6 years, 27 weeks, 2 days ago