How to update mongodb collection with ssh from a shell script?
For me this works fine

ssh mongodb.domain.com "mongo --eval='db.getSiblingDB(\"testi\").empty.update({},{\$set:{key:1}},{multi:true})'"


The catch is \ before $ because otherways shell will "expand" that $set "enviroment variable", what of course don't exists.