How to bulk update a set of objects matching a query

Is there a way to update objects that satisfy a query without having to retrieve the objects then save them individually?
Object foo - {a: number}
query - {a: 10}
Update foo, set a = 0 for matching objects.

I don’t think there is a way to do this. You have to retrieve objects first.

1 Like

Since Parse server got some hook functions like before and after save, it do not support currently this type of update.
If you need to update a lot of objects you can use the .each on a Parse query.

@uzaysan, @Moumouls,
Thank you guys. I think I will use .each.

You can use Query.eachBatch and then saveAll to save them by batch.