MongoDB Java pull -


i tried remove embedded document without succcess. i'm looking java way of following instruction:

db.games.update({'_id': 73}, {$pull: {'goals': {'goal': 4}}}) 

the java documentation pretty clear, constructing bson objects match respective json counterparts used in shell:

    basicdbobject query = new basicdbobject("_id", 73);     basicdbobject fields = new basicdbobject("goals",          new basicdbobject( "goal", 4));     basicdbobject update = new basicdbobject("$pull",fields);      games.update( query, update ); 

Comments

Popular posts from this blog

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -