Puoi scegliere tra:
Mangusta Object-way:
document.dots[0].location.push({ /* your subdoc*/ });
document.save(callback);
Query Mongo/Mongoose (usando $push
e $
operatore
):
YourModel.update(
{_id: /* doc id */, 'dots.id': /* subdoc id */ },
{$push: {'dots.$.location': { /* your subdoc */ }},
callback
);