How can I remove an item from an array inside another array on mongoose

  arrays, javascript, mongodb, mongoose, remove

i need to remove an object from an array which is inside another array

async function removeEp(id, sectionindex, productindex) {
    let t = await Stores.findById(id);
    t.sections[sectionindex].eps.splice(productindex,1);
    await t.save();
    return t;
}

i tried this code but it doenst changed nothing on database

Source: Ask Javascript Questions

LEAVE A COMMENT