Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Updating Multiplb Objects/Rows in Parse Dashboard

Im new to parse.com. Is it possible to update multiple objects/rows in Parse dashboard? Something like running update query in dashboard?

Parse.Object.update({...some filter...}, {...some values...})

Thanks

like image 443
JR Galia Avatar asked Jul 20 '14 13:07

JR Galia


Video Answer


1 Answers

There's no SQL-like UPDATE syntax. You would need to query for and iterate through the results, making the changes to each object. The each method is provided on a Parse.Query for processing every record that matches:

var query = new Parse.Query("MyClass");
query.equalTo("someField", "someValue");
query.each(function(obj) {
  obj.set("otherField", "otherValue");
  return obj.save();
}).then(function() {
  // All objects updated.
}, function(err) {
  console.log(err);
});
like image 118
Fosco Avatar answered Oct 01 '22 09:10

Fosco