Mongodb RoboMongo gte日期查询

Mongodb RoboMongo gte日期查询,mongodb,robo3t,Mongodb,Robo3t,为什么RoboMongo 1.0会返回以下对象: { "code" : "bar", "value" : 133.63, "at" : "2017-05-03T10:42:08.000+1000" "_id" : ObjectId("590927605105bf499025c202") } 从以下查询: db.getCollection('foo').find({ "at" : { $gte : new ISODate("2017-05-03T10:45:00.000+1000")} })

为什么RoboMongo 1.0会返回以下对象:

{
"code" : "bar",
"value" : 133.63,
"at" : "2017-05-03T10:42:08.000+1000"
"_id" : ObjectId("590927605105bf499025c202")
}
从以下查询:

db.getCollection('foo').find({ "at" : 
 { $gte : new ISODate("2017-05-03T10:45:00.000+1000")}
})
?

我正在尝试在上午10:45之后获取所有记录,库有助于更改日期并确定您想要的日期

您可以通过以下方式要求npm模块:-

如果要设置特定的UTC日期,只需输入所需的MomentDate即可

查询将是:-

db.getCollection('foo').find({ "at" : 
 { $gte : fromDate }
})

谢谢

您可以使用robo3t客户端进行查询,如:

db.getCollection('foo').find({"at": {$gte: new ISODate("2020-04-26")}}).sort({"_id":-1})

排序{u id:-1}用于按降序排序以获得插入的最新项目。

是否存储为日期?或者它只是一个字符串?作为时间戳:timestam1493772128,10,假设填充集合的代码是NodeJS,这有什么关系?此外,我已经说过数据是一个时间戳
db.getCollection('foo').find({"at": {$gte: new ISODate("2020-04-26")}}).sort({"_id":-1})