erick21

Untitled

Apr 30th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. var thisQuery = tableModel.find();
  2. thisQuery.select('name');
  3. thisQuery.sort('name');
  4. thisQuery.where('status', 'Active');
  5. thisQuery.exec(function(err, items) {
  6. if (err){
  7. console.log('######## '+new Date()+', SOCKET iWantListName RUN : ' + err);
  8. }else{
  9. async.each(items,function(eachItem,callbackEach) {
  10. tableModel.update({
  11. '_id' : eachItem._id
  12. },{
  13. $set: {
  14. 'quota_trip' : [1,2,3,4]
  15. }
  16. },function(error,result) {
  17. callbackEach();
  18. });
  19. }
  20. },function(errEach) {
  21.  
  22. });
  23. });
Advertisement
Add Comment
Please, Sign In to add comment