mongodb命令查漏补缺

1.配置启动mongodb

%MONGO_HOME%/bin/mongod --config=XXXX

 

2.mongodb查询(时间+范围+排序):

db.getCollection('temp').find({
"type": {
  $in: ['1', '2']
},
"createDate": {
  $gte: ISODate("2019-09-10T12:52:33.341Z"),
  $lte: ISODate("2019-09-20T12:52:33.341Z")
}
}).sort({
  'createDate': - 1
});

posted @ 2019-09-06 17:38  带你走天涯  阅读(130)  评论(0编辑  收藏  举报