如何用java 实现mongodb 删除数组中一个value 5
{"_id":ObjectId("598d1c4f3740a9caae35a80a"),"_id":ObjectId("598d1c4f3740a9caae35a80a"...
{
"_id" : ObjectId("598d1c4f3740a9caae35a80a"),
"_id" : ObjectId("598d1c4f3740a9caae35a80a"),
"Authentication" : "abcd",
"Type" : "ddddd",
"Data" : {
"Accounts" : [
{
"GLNID" : "GAG001ORCL",
"DMUIDs" : [
"1213614745",
"1214205553"
]
}
],
"SelectedAccount" : {
"GLNID" : "GAG001ORCL",
"DMUIDs" : [
"1212317330"
]
},
"Image" : null,
}
}
如何 java 实现 删除 1214205553
使用的 方法 应该怎么解决
BasicDBObject updateObject = new BasicDBObject("Data", new BasicDBObject().append("$pull",
new BasicDBObject("Accounts", new BasicDBObject("DMUIDs", "1214205553"))));
System.out.println(updateObject);
coll.update(query, updateObject); 展开
"_id" : ObjectId("598d1c4f3740a9caae35a80a"),
"_id" : ObjectId("598d1c4f3740a9caae35a80a"),
"Authentication" : "abcd",
"Type" : "ddddd",
"Data" : {
"Accounts" : [
{
"GLNID" : "GAG001ORCL",
"DMUIDs" : [
"1213614745",
"1214205553"
]
}
],
"SelectedAccount" : {
"GLNID" : "GAG001ORCL",
"DMUIDs" : [
"1212317330"
]
},
"Image" : null,
}
}
如何 java 实现 删除 1214205553
使用的 方法 应该怎么解决
BasicDBObject updateObject = new BasicDBObject("Data", new BasicDBObject().append("$pull",
new BasicDBObject("Accounts", new BasicDBObject("DMUIDs", "1214205553"))));
System.out.println(updateObject);
coll.update(query, updateObject); 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询