title: Need to update multiple collections on sailsjs
body: <p>I did a component for manage categories weight and parents using nested lists . When i finished dragging i send a post with list serialized and i want to update the categories with the new options and send a Json with the status to the view. I tried to much things but any works. Now im trying to make a loop with a counter thats increments in each category update using Categories.update() callback but doesnt works. Any suggestion?</p>
  
  <p>My code (data is empty and error is null):</p>
  
  <pre><code>var total = list.length;
  var updated = 0;
  var errors = [];
  list.each(function(category){
  
      Categories.update({id: category.id}, {parent: category.parent}, function(err, data){
         updated++
         if(err)
          errors.push(err);
  
         if(updated==total)
            if(errors.length)
                res.status(400).json(errors);
            else
                res.status(200).json();
  
     });
  
  });
  </code></pre>
  
  <p>P.D.: I tried also with setInterval for check updated and do the res.status...</p>