[DOCS-9458] Docs for SERVER-25685: Extend update command to perform per-operation validation Created: 02/Dec/16  Updated: 27/Oct/23  Resolved: 08/Aug/17

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Emily Hall Assignee: Allison Reinheimer Moore
Resolution: Gone away Votes: 0
Labels: 02-24-2017
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 6 years, 27 weeks, 2 days ago

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



 Comments   
Comment by Kay Kim (Inactive) [ 08/Aug/17 ]

Closing as the ticket has been opened too soon. REmoved link to server ticket so can reopen new ticket via script when ready for doc'ing.

Generated at Thu Feb 08 07:58:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.