I have a document that looks like
{
_id: ObjectId("someId"),
recipients: [
{
email: "emailaddress"
},
{
email: "email2"
}
]
}
I am trying to update the first recipient object, and add another property but to no avail.
{
_id: ObjectId("someId"),
recipients: [
{
email: "emailaddress",
new_prop: "something"
}
]
}
Is there a way to do this with findOneAndUpdate? I am using PHP