parse-community / parse-community/parse-server
RFC: Save Triggers should be able to filter Operations
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 21.4k
- Forks
- 4.8k
- Avg merge
- 7h 45m
- Merged PRs (30d)
- 11
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Parse.Cloud.beforeSave entry point and inspect how req.object._getPendingOps() exposes pending operations. Define the supported operation-filtering behavior from the score and otherTeamScore examples, including multiple allowed operations, and verify the trigger validation flow before considering the feature complete.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100