I need to check (and take appropriate action) if an object is just being created, or an already-existing object is being updated with new values. Is there any way to check this accurately?
Yes there is. A new object will not have an id yet, so you can check the object if it has an id.
Parse.Cloud.beforeSave("MyClass", function (request, response) {
var object = request.object;
if (!object.id) {
// this is a new object
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With