我正在尝试执行此查询:
db.indexInverse.find({_id:ObjectId("5a153409b9c52933c8aab068")}).pretty()
使用Java ...
实际上我尝试了很多东西......但是找不到我的文件......
Document vraiDoc = collectionIndexInverse.find(Filters.eq("_id", new ObjectId("\"" + idDoc + "\""))).first();
OR
Bson query = (Bson) new BsonString("{ _id:ObjectId(\"" + idDoc + "\")}");
Document vraiDoc = collectionIndexInverse.find(query).first();
OR
Bson query = (Bson) new BsonString("{ _id:ObjectId(idDoc)}");
Document vraiDoc = collectionIndexInverse.find(query).first();