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
});