drilonrecica
drilonrecica

Reputation: 337

How to delete all objects returned from a ParseQuery in android?

I wanted to know how I can possibly delete all ParseObjects that I get returned from a ParseQuery. The ParseQuery will have to find all objects that contain a specific String ("keyString") in a specific field ("keyField") as in query.whereEqualTo(keyField , keyString).

Then all the objects than contain that keyString will have to be deleted.

Thank you all in advance?

Upvotes: 2

Views: 471

Answers (2)

dave
dave

Reputation: 575

ParseQuery query = new ParseQuery("ParseObject");
ParseObject.deleteAllInBackground(query.find());

something like this

Upvotes: 0

CQM
CQM

Reputation: 44238

Use ParseObject.deleteAllInBackground and this will achieve what you want. Pass it an array of parse objects.

At this point in time, each object deleted will count as 1 parse request, instead of one single query.

Upvotes: 2

Related Questions