I am trying to cascade delete all subobjects contained in an array of pointers when a parent object is deleted, but I am getting an error.
This is my code:
Parse.Cloud.beforeDelete("Parent", function(request, response) {
var children = request.object.get("children");
Parse.Object.destroyAll(children, {
success: function() {
response.success();
},
error: function(error) {
console.error("Error deleting related children " + error.code + ": " + error.message);
response.error(error);
}
});
}); As I said, Parent has a children property, which is an array of pointers to Child objects. This is the error I get: "Error deleting related 600 children: error deleting an object in destroyAll"
source
share