MongoDB: update dictionary in document
问题 I have a MongoDB document that saves occurrences of some things in a dictionary: { "id" : 1, "occurrences" : { "1" : 1, "2" : 5, "17" : 1, "35" : 4 } } I now want to add or update some entries, for example add a "12:3" to the occurrences, or update the number of occurrences of "17" to 2, so let's say as an example I want to add {"12":3} and {"17":2} to this dictionary. It is driving me crazy because I simply can not get it to work. I could use arrays and all that, but I would really like to