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

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

javascript - jquery or ashx not working -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -