I have a collection called Names with a document that looks like this:
{
"_id":33,
"listOfNames" : ["John", "Fred", "Andy"]
}
I am trying to do an update command that looks like the following:
db.Names.update{{}, {$set: {"listOfNames" : ["John", "Mary"]}, {multi:true})}
This fails with "unexpected token". What is the correct syntax to use when updating a field in a series of documents when the field is an array?