What is the command to update a mongo collection. I have a variable id and key and the key is newly introduced. I want to update each document in the mongo collection by writing a new variable "key" that has the same value as "id"
So far I have
db.collectionname.update({}, ,{multi:true})
Sorry, I'm new to mongo and would appreciate some good study/reading material
Thanks