[英]How can I remove an item from an array inside another array on mongoose
我需要从另一个数组中的数组中删除 object
async function removeEp(id, sectionindex, productindex) {
let t = await Stores.findById(id);
t.sections[sectionindex].eps.splice(productindex,1);
await t.save();
return t;
}
我试过这段代码,但它并没有改变数据库
我需要从另一个数组中的数组中删除 object
async function removeEp(id, sectionindex, productindex) {
let t = await Stores.findById(id);
t.sections[sectionindex].eps.splice(productindex,1);
await t.save();
return t;
}
我试过这段代码,但它并没有改变数据库
我需要从另一个数组中的数组中删除 object
async function removeEp(id, sectionindex, productindex) {
let t = await Stores.findById(id);
t.sections[sectionindex].eps.splice(productindex,1);
await t.save();
return t;
}
我试过这段代码,但它并没有改变数据库
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.