title: Parse.com - modify all the users in background job .each() doesn't work with order and .find() finishes too fast
body: <p>I am trying to get all the user data, and sort them descending by Age, then modify the age for everyone. but when i use <code>query.find()</code>, it finishes too fast. Only top 2 or 3 users age would be saved correctly. Then i try to use <code>query.each()</code>, but it doesn't work with descending order.</p>
  
  <p>Here are the codes i have when using query.each(), if i don't order them, it will save all the users correctly, but i need to order them and change their age based on the order.</p>
  
  <pre><code>Parse.Cloud.job("ChangeUserAge", function(request, status) {
      Parse.Cloud.useMasterKey();
      var counter = 0;
      var query = new Parse.Query(Parse.User);
      query.descending("age, name");
      query.each(function(user) {
          counter += 1;
          user.set("age", counter);
              return user.save();
      }).then(function() {
          // Set the job's success status
          status.success("ChangeUserAge completed successfully.");
      }, function(error) {
          // Set the job's error status
          status.error("ChangeUserAge went wrong.");
    });
  });
  </code></pre>
  
  <p>and here are the codes i have when using query.find(), which the problem is that finishes too fast. only 2 or 3 users saved correctly.</p>
  
  <pre><code>Parse.Cloud.job("RankingAllUserBasedOnDiamonds", function(request, status) {
      Parse.Cloud.useMasterKey();
      var query = new Parse.Query(Parse.User);
      query.descending("age, name");
      query.find().then(function(results) {
          for(var i = 0; i &lt; users.length; i++)
          {
              var user = users[i];
              user.set("age", i+1);
              user.save();
          }
      }).then(function() {
           // Set the job's success status
               status.success("ChangeUserAge completed successfully.");
      }, function(error) {
          // Set the job's error status
              status.error("ChangeUserAge went wrong.");
       });
  });
  </code></pre>