Swift Delete Multiple Objects at Once Parse Server

Swift Delete multiple objects at once Parse server

I want to know if it would be possible to delete all the found objects at once

Yes in the Parse iOS SDK to delete multiple objects in background at once on Parse server, you can use deleteAllInBackground

You can use it with 2 different ways:

PFObject.deleteAll(inBackground: [PFObject]?)
PFObject.deleteAll(inBackground: [PFObject]?, block: PFBooleanResultBlock?)

For example:

let query = PFQuery(className: "posts")
query.whereKey("uuid", equalTo: Ncell.uuidLbl.text!)
query.findObjectsInBackground { (objects:[PFObject]?, error:Error?) in
if error == nil {
PFObject.deleteAll(inBackground: objects, block: { (success:Bool, error:Error?) in
if success {

}
})
}
}

I hope my answer was helpful /p>

How to delete objects from an array stored in Parse column

You can use removeObject:forKey: to only remove this single object from the array. After doing this, call saveInBackground to save the changes back to the server.

See also: https://www.parse.com/docs/ios/guide#objects-arrays

Removing multiple objects from an NSMutableArray

Look at the - (void)removeObjectsInArray:(NSArray *)otherArray method of NSMutableArray

Delete all children of an object in Parse CloudCode

Now that Parse Server is open source, this question became irrelevant as I can remove all those limitations myself :-)

ios Swift Program app to delete things from parse after x amount of time?

you can query through, get the createdAt date of the parse object and compare it to the current time, then delete it if its overdue.

wherever the data is retrieved, if they are user posts, you can put the query wherever you load the user posts. Once any one person tries to load that data and it's too old, it will be deleted and no one will see it.



Related Topics



Leave a reply



Submit