I need to modify a nested array. In this example I would like to remove content 2
from the target array of the object with the id ZFrNsQKSY6ywSzYps
var array = [
{ _id: "QKSY6ywSzYpsZFrNs", target: ["content 1"]}
{ _id: "ZFrNsQKSY6ywSzYps", target: ["content 1", "content 2"]}
{ _id: "SzYpsZFrNQKSY6yws", target: ["content 1"]}
]
I tried to use find()
but with that I do not update the array. So this seems not to be the correct approach.