MongoDB
 sql >> Database >  >> NoSQL >> MongoDB

MongoDB Aggiorna un array nidificato

prova con questo metodo

conditions = {
    "_id": ObjectId"57ce1a55899bf934e59edd0d",
    "iterations.iterations_name": "Iteration2"
  };
updates = {
   $push: {
     "iterations.$.tasks": "success"
   }
};
options = {
  upsert: true
};
Model.update(conditions, updates, options, callback);