title: How to count total users in a BeforeSave CloudCode on Parse Platform
body: <pre><code>Parse.Cloud.beforeSave(Parse.User, function(request, response) {
      var query = new new Parse.Query(Parse.User);
      query.count({
        success: function(count) {
          request.object.set("membersNumber", count+1);
          response.success();     
        },
        error: function(error) {
          response.success(); 
        }
      });
  });
  </code></pre>
  
  <p>On a Parse backend, I want to assign a sequential number to every user who registered. For example, first member will get a membersNumber = 1, second member will get a membersNumber = 2, etc. </p>
  
  <p>But the code above fails. Count is always zero. I suspect the beforeSave function does not have the master credentials to get all user objects?</p>
  
  <p>How can count the total users in this beforeSave method? </p>