2

I created a new column in a table of 10k records. Now I want to update/fill that column with some value. I am using following javascriptcode.

  function updateAll(query, updater) {
    return query.each(function(object) {
       updater(object);
       return object.save();
    });
  }

Parse.Cloud.define('batchUpdateReports', function(request, response) {
  // Use the Master Key if you need to override ACLs
  Parse.Cloud.useMasterKey();

  var Property = Parse.Object.extend('Property');
  var query = new Parse.Query(Property);
  // Modify the query if you only want to update certain properties
  query.notEqualTo('reportType', 'Routine_Inspection');

  updateAll(query, function(property) {
    // Update the property object as you need
    property.set('reportType', 'Routine_Inspection');
  }).then(function() {
    response.success();
  }).fail(function(e) {
    response.error(e);
  });
});

Nothing is happening and no error in parse log Thanks in advance

Ahsan aslam
  • 1,149
  • 2
  • 16
  • 35

0 Answers0