0
我正在嘗試使用對象ID更新文檔,但沒有收到結果。這裏是我的代碼請幫我我們可以使用_id在java中更新mongodb中的文檔嗎?
DBCollection patients= db.getCollection("Patients");
BasicDBObject doc = new BasicDBObject();
doc.put("name","seshu");
DBObject update=`new` BasicDBObject().append("_id",ObjectId("534e1c8e40a8af540cd01ff4"));
patients`enter code here`.update(update, doc);