示例#1
0
 function(cb){
     Feed.update({_id: data._id}, {unread: 0}, function(err){
         if(err){
             cb(err);
             return false;
         }
         cb(null);
     });
 }
示例#2
0
    	}, function (err, count) {
			if (err) {
				logger.log('info', "Cannot recalculate feed:unread property");
				return false;
			}

			Feed.update({ _id: id_feed }, { unread: count }, function(err, numberAffected, raw){
	            if(err){
	                logger.log('info', "Cannot set feed:unread property");
	                return false;
	            }
	        })
		});
    	}, function (err, count) {
			if (err) {
				logger.log('info', "Cannot recalculate feed:hasReadLater property");
				return false;
			}

            if( count == 0 ){
                hasReadLater = false;
            }else if( count > 0 ){
                hasReadLater = true;
            }

			Feed.update({ _id: id_feed }, { hasReadLater: hasReadLater }, function(err, numberAffected, raw){
	            if(err){
	                logger.log('info', "Cannot set feed:hasReadLater property");
	                return false;
	            }
	        })
		});