Q:

Changing values of Parse column using Parse Code Cloud Javascript function

So its my first time writing Javascript so please bear with me. I wrote this function in order to query a class in my Parse.com application, and then after querying I want to set one of the columns (of type Boolean) to true. 
I set up a test class with only 7 values in order to test.
The problem: only 3 out of 7 are being changed. Do I have to wait after each save? I know that waiting/sleeping in Javascript is "wrong" but I can't seem to find a solution.
Thanks in advance! 
Additionally, when using iOS/Parse, I would like to check if the boolean value is undefined in Objective-C, I already tried to compare it to nil/NULL, an exception was thrown
Parse.Cloud.define("setYears", function(request, response) {
var object = new Parse.Query("testClass");

object.find({
success: function(results)
{
for (var i = 0; i < results.length; i++) {
    results[i].set("testBool",true);// = true;
    results[i].save(null,

         {
            success:function ()
            {
                response.success("Updated bool!");
            },
            error:function (error)
            {
                response.error("Failed to save bool. Error=" + error.message);
            }

        });

};

response.success();

}
})
});

A:

It turned out to be not that difficult to solve as stated above. Just had to use saveAll instead of saving each object by itself. Here is the correct solution if anybody needs it:
Parse.Cloud.define("setYears", function(request, response) {
var object = new Parse.Query("testClass");

object.find({
success: function(results)
{
for (var i = 0; i < results.length; i++) {
    results[i].set("testBool",true);// = true;  
}

Parse.Object.saveAll(results,{
success: function(list) {
  // All the objects were saved.
  response.success("ok " );  //saveAll is now finished and we can properly exit with confidence :-)
},
error: function(error) {
  // An error occurred while saving one of the objects.
  response.error("failure on saving list ");
},
});

response.success();

}

  })

});

