我们有代表文档上传作业的文档集合,如下所示:
{
"_id" : NumberLong(807106),
"_class" : "com.*.FileUploadJob",
"createdDate" : ISODate("2018-12-12T17:04:32.042Z"),
"jobConfigurationId" : NumberLong(5382),
"fileName" : "807106.xlsx",
"rowCount" : NumberLong(2),
"successfullyStagedRowsCount" : NumberLong(1),
"status" : "COMMIT_COMPLETED",
"rowProcessingComplete" : true
}
当我尝试查找此记录时,以下任何一项均无效:
db.fileUploadJob.find({"_id": ObjectId(807106)})
db.fileUploadJob.find({"_id": ObjectId("807106")})
db.fileUploadJob.find(ObjectId("807106"))
db.fileUploadJob.find({"_id": "807106"})
db.fileUploadJob.find({"_id": 807106})
...
如何找到难以捉摸的条目?
答案 0 :(得分:0)
找到了答案!
db.fileUploadJob.find({"_id": NumberLong(807106)})
我必须将文档JSON复制并粘贴到Robo3T的文本编辑器中,以查看其类型!