Look at UpdateOperations.removeAll(java.lang.String, java.lang.Object) I think that'll get you what you need.
How to delete n-th element of array with morphia
Domanda
For example i have a document
{
_id: 1,
list:[
{
key: "a",
"value":"ssss"
},
{
key: "b",
"value":"ssss"
},
{
key: "c",
"value":"ssss"
},
]
}
and i need remove element with "c" key from the list.
With mongo console command i make like this and remove correct key
db.test.update({{_id: 1},{"$pull" : {"list" : { "key" : "c"}}},false,false)
there is a way to do it with morphia?
Soluzione
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow