Backendless Support
 
Answered

How to do a bulk delete

Hello,

ich have a app that matches two users. Then they can chat/exchange messages. These messages are stores in a special table called "Messages".

Now when the day comes that a user deletes the match, I want to delete the messages as well to prevent any anomalies. How can I bulk-delete all messages associated to the two users?

That is what the table looks like:

7da39517b4ba4f67f6f4a6c2f5c3ce5f

I do have the ID's/Objects of the two users at the time I want to delete the messages.

I want to execute it on the ServerCode using Java a my language-of-choice. Would I be possible from the Android client as well?

Leave a Comment

Comments (3)

photo
1

Hi Felix

Unfortunately you can do that only via REST

  1. https://api.backendless.com/<app version>/data/bulk/<table-name>?where=<where clause>

See documentation here:

https://backendless.com/documentation/data/rest/data_deleting_data_objects.htm

Regards, Vlad

photo
1

That is sad, but do you also provide docs on how to simply call the REST API from Java?

photo
1

Hi Felix

I'm really sorry that there is no method for bulk deleting in Android-SDK yet, but this your question is out of the free support policy.

I can suggest you seek information about how to implement working with REST API on some JAVA forum.

Regards, Ilya

photo