Per aggiungere un campo a una mappa incorporata, usa la dot notation insieme all’operatore $set.
Esempio
db.collection.update({ "_id": 1 }, { "$set": { "map.field3": 2 } })Il risultato sarà un documento con il nuovo campo aggiunto alla mappa.
Per aggiungere un campo a una mappa incorporata, usa la dot notation insieme all’operatore $set.
db.collection.update({ "_id": 1 }, { "$set": { "map.field3": 2 } })Il risultato sarà un documento con il nuovo campo aggiunto alla mappa.