M103 Lab-Launching Mongod - creating user


Check this error:

MongoDB Enterprise > mongo admin --host localhost:27000 --eval ‘db.createUser({user:“m103-admin”,pwd:“m103-pass”,roles:[{role:“root”, db:“admin”}]})’
2019-11-17T19:40:50.042+0000 E QUERY [thread1] SyntaxError: missing ; before statement @(shell):1:6
MongoDB Enterprise >
Can’t see where I’m missing ;


Literally just copy and paste what is in the lab and it will work. Don’t try and tidy up the breaklines or spaces.

You are running the eval command at mongo prompt
Please exit and run at OS prompt
It should work


Good catch @Ramachandra_37567. I didn’t notice that!