I have a document structured as so: (simplified to get to the point)
{
"_id" : "WRcx25SxCxQHA29Be",
"whichUser" : "KKCjvgbQKm7ahfNd5",
"textSpans" : [ {
"_id" : "ExxMXBc3T6dtDZbRC",
"textValue" : "the special tonight is chicken"
},
{
"_id" : "4kPWbEH3GhppqrEYt",
"textValue" : "more text"
}
]
}
given a particular text-spans "_id" field, how can I perform an update?
ChosenCards.update({_id:myChosenCardId}, {$set: { ??
(note, this is not a question about how to use explicit array indices.)
Which Mongo options will allow me to update a field in a subdocument given that sub-documents _id?