från mongoDb-webbplatsen titta på "Ange fält i inbäddade dokument"
To specify a <field> in an embedded document or in an array, use dot notation.
For the document matching the criteria _id equal to 100, the following
operation updates the make field in the details document:
db.products.update(
{ _id: 100 },
{ $set: { "details.make": "zzz" } })
i ditt fall
db.collection.update(
{_id:ObjectId("1")},
{ $set: { "occurrences.12": "3", "occurrences.17": "2" }})