I\'m using mongo 2.2.3 and the java driver. My dilemma, I have to $push a field and value into an array, but I cant seem to figure out how to do this. A sample of my data:<
If you're more comforable with the query format of the shell, you may find it's easier to use JSON.parse to contstruct your DBObject for the $push:
JSON.parse
DBObject
$push
import com.mongodb.util.JSON; String json = "{$push:{scores:{type:'quiz', score:99}}}"; DBObject push = (DBObject) JSON.parse(json);