Cascading Deletes

Two questions: I know that cascading deletes is on your dev roadmap. Any idea when we can see this new feature? I’m using the iOS SDK.

In the meantime, what is the best way to delete related items when deleting the parent? I’ve tried removing them from the parent object and saving the parent, but that just removes the relationship, and leaves the child objects in the related table.

In my app I have a table of forum posts, and a related table of comments, with a one-to-many relationship between posts and comments. When I delete a post, I want to delete all the related comments. Seems like there is no way to accomplish this in the SDK without doing multiple API calls, one to delete the parent, and one for each of the now orphaned comment objects.

Hi Jay,

When you delete a comment, it will not only delete the object, but will break the relationship between the comment and the corresponding post object.

If you were to do it from the client side, it would result in greater number of calls. A better performing alternative would be to create a custom service that deletes everything on the server-side. Here’s more info on custom services:
https://backendless.com/documentation/api-engine/apieng_overview.htm

Regards,
Mark