如何编写一个MongoDB shell查询,该查询将返回在特定日期之后创建的所有对象的文档?如何删除基于ObjectId的文档(_id)
类别,如:
{
"_id" : ObjectId("59918c9014450171039b7e1f"),
"cont_id" : "59918c9014450171039b7e1d",
"systemdate" : ISODate("2017-07-25T00:09:00.567Z"),
}
db.itemtable.count({"systemdate" : { $gte: ISODate("2017-07-25T00:00:00.000Z")}})
返回 - 15210
db.itemtable.count({'_id': {'$gt' : ObjectId("59918c9014450171039b7e1f")}})
返回 - 987652个
谢谢! Bharathi
不使用续({} ...)使用发现({ “systemdate”:{$ GTE:ISODate(“2017-07- 25T00:00:00.000Z“)}}) – Jackstine