[英]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.