阅读背景:

过滤结果时丢失MongoDB日期解决方案。 Node.js的/回环

来源:互联网 
function(){
  var currentDate = new Date();
  var twentyFourHours = 24*60*60*1000;
  var limit = currentDate - twentyFourHours;

  aModel.find({where:{property:something, timeStamp:{gt:limit}}},function(err,models){
    models.forEach(function(oneModel){
      console.log(oneModel.timeStamp);
      //Tue Apr 05 2016 19:48:03 GMT+0000 (UTC)
      //no ms resolution
    });
  }
}
function(){
  var currentDate = new Date();
  v



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: