Database

[{"_id":1,"comments":[{"id":1,"answer":"fred"},{"id":ObjectId("000000000000000000000002"),"answer":"barney"},{"id":3,"answer":"wilma"},{/** this has the same "id" as above*/"id":ObjectId("000000000000000000000002"),"answer":"bambam"}]}]

Query

db.collection.update({"_id":1,"comments.id":{"$in":[2,ObjectId("000000000000000000000002")]}},{/** only updates the first "match"*/"$set":{"comments.$.answer":"dino"}})

Result