91删除数据

var d_startsec = 245322000,
    d_endsec = 245323800;

var channel_id = 3131;
for(var noid = 0;noid <= 682; noid++){
    var pointData = db.last.findOne({"channel_id": "" + channel_id,"no_ai": "" + noid,"date": "2017-10-10"});
    var zset = pointData.zset;
    for(var i = 0;i < zset.length;i++){
        var hourData = zset[i];
        if(hourData.hour == 9){
            var dataAry = hourData.dataMin[0];
            for(var j = dataAry.length - 3;j >= 0;j-=3){
                if(dataAry[j] >= d_startsec && dataAry[j] <= d_endsec){
                    dataAry.splice(j,3);
                }
            }
        }
    }

    db.last.update({"_id": pointData._id},pointData);
}

 

posted on 2017-10-11 10:40  石头hah  阅读(212)  评论(0编辑  收藏  举报

导航