this.db.object (& hellip;). push не является функцией в Ionic

Сделайте объект обновления с именами свойств, включая нужный путь. («somekey.» + из примера OP), а затем используйте это обновление.

//the modification that's requested
updateReq = { 
   param2 : "val2_new",
   param3 : "val3_new"   
}

//build a renamed version of the update request
var update = {};
for(var field in updateReq){
    update["somekey."+field] = updateReq[field];
}

//apply the update without modifying fields not originally in the update
db.collection.update({._id:...},{$set:update},{upsert:true},function(err,result){...});
2
задан georgeawg 18 March 2019 в 06:14
поделиться