I am trying to update a field from command line (NOT from mongo shell)
mongo mydb --eval "db.users.update({}, { $set : { email : "[email protected]" } })"
results into
Fri Oct 24 12:23:46.102 JavaScript execution failed: SyntaxError: Unexpected token :
Again trying
mongo mydb --eval "db.users.update({}, { $set : { email : \"[email protected]\" } })"
same results
Fri Oct 24 12:24:05.559 JavaScript execution failed: SyntaxError: Unexpected token :
Any help for the same ?