Số liệu được đưa ra như sau:MongoDB: Không thể canonicalize truy vấn: BADVALUE chưa biết khai thác
{
"_id" : { "$oid" : "546b79a2e4b0f7bfbaa97cc7" },
"title" : "Eyewitness: Highlands, Scotland",
"description" : "Photographs from the Guardian Eyewitness series",
"timeStamp" : "14/11/2014",
"category" : "news",
"url" : "http://www.theguardian.com/world/picture/2014/nov/14/1",
"source" : "http://www.theguardian.com/",
"mainStory" : "\n",
"keywords" : [ "Wildlife", "Scotland" ]
}
Nhưng khi tôi sử dụng lệnh sau đây để tìm một cái gì đó, lỗi đi ra
db.guardian.find({ "_id": {"$oid": '546b79a2e4b0f7bfbaa97cc7'}})
Làm thế nào tôi có thể tìm thấy tài liệu với $oid
cụ thể.
Đó là thật sự tốt đẹp – Wyatt
Nếu bạn đang sử dụng nodejs thì bạn cũng cần phải yêu cầu ObjectId với var ObjectId = require ('MongoDB') ObjectId. – strttn