Reputation: 3
I am trying to total the number of employees who are all taking more then 15000 salary.when i add the employee details it will automatically total the employees and give the total number using trigger operation in Parse. how can i do this.
Upvotes: 0
Views: 38
Reputation: 26064
Using cloud code, you can add an afterSave trigger:
Parse.Cloud.afterSave("Employee", function(request) {
//get the total number of employees that earn more than 15000
//do push notification or what you want
});
When a new "Employee" is inserted, that code will be executed.
Check this link out for more info about triggers:
https://parse.com/docs/cloudcode/guide#cloud-code-aftersave-triggers
Upvotes: 1