MongoDB
 sql >> Datenbank >  >> NoSQL >> MongoDB

(MongoDB Java) $push in Array

DBObject listItem = new BasicDBObject("scores", new BasicDBObject("type","quiz").append("score",99));
DBObject updateQuery = new BasicDBObject("$push", listItem);
myCol.update(findQuery, updateQuery);