生成指定时间内的日期

for (var i = 1; i <= 30; i++)  {
db.wechatAttention.save({_class:"la.xiaoxiao.manager.wechat.entity.WechatAttentionEntity",ghId:"gh_"+ObjectId().valueOf(),openId:ObjectId().valueOf(),createDate:new Date(new Date()- Math.ceil(Math.random()*(29526208000)+1)),userId:"",mark:"false"});
}

修改

db.wechatAttention.update({mark:"false"},{$set:{mark:true}},false,true);

 

posted @ 2015-12-19 17:48  wind90  阅读(269)  评论(0编辑  收藏  举报