I am trying to do the following in mongodb
update table1 set name = name1
I am using:
db.table1.updateMany(
{},
{
$set: {name: "$name1".}
}
)
However when i check the collection, the value for name = $name1 (meaning it just put it in as a string). I am expecting the value of name1 to be in the field name.
Have tried this on 4.2.