-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Open
Labels
type:featureNew feature or improvement of existing featureNew feature or improvement of existing feature
Description
New Feature / Enhancement Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
Current Limitation
If this is approved
by the maintainers we will submit a PR in the near future
Very simple use case and i think this feature could be used in many cases. Lets say you have a counter, and you want to limit operations on it.
Feature / Enhancement Description
Since triggers can already perform validation operations on fields, add a way to validate the type
of operation that are performed
Example Use Case
Parse.Cloud.beforeSave('GameScore', (request) => {
// ....
}, {
fields: {
score: {
required : true,
opType : Parse.Op.Increment
},
otherTeamScore: {
required : true,
opType : [ Parse.Op.Unset , Parse.Op.Increment ]
},
}
})
Alternatives / Workarounds
In the trigger, iterate through req.object._getPendingOps()
3rd Party References
dblythy
Metadata
Metadata
Assignees
Labels
type:featureNew feature or improvement of existing featureNew feature or improvement of existing feature