Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var thisQuery = tableModel.find();
- thisQuery.select('name');
- thisQuery.sort('name');
- thisQuery.where('status', 'Active');
- thisQuery.exec(function(err, items) {
- if (err){
- console.log('######## '+new Date()+', SOCKET iWantListName RUN : ' + err);
- }else{
- async.each(items,function(eachItem,callbackEach) {
- var listQuotaTripNew = [];
- var index = 0;
- eachItem.quota_trip.forEach(function(eachQuotaTrip) {
- listInputannya.forEach(function(eachInputannya) {
- if(index == eachInputannya.index) listQuotaTripNew.push(eachInputannya.value);
- else listQuotaTripNew.push(eachQuotaTrip);
- index++;
- });
- });
- tableModel.update({
- '_id' : eachItem._id
- },{
- $set: {
- 'quota_trip' : listQuotaTripNew
- }
- },function(error,result) {
- callbackEach();
- });
- }
- },function(errEach) {
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment