September 2018
Beginner to intermediate
192 pages
4h 37m
English
To authenticate as a user using the mongo shell, you can use the command-line parameters that are summarized here:
| Short Syntax | Long Syntax |
| -u <username> | --username <username> |
| -p [<password>] | --password [<password>] |
If you do not specify a password but use the -p or --password flag, you will be prompted for the password interactively. You will also need to add the following parameter if the database in which the user created is not the one you wish to connect to:
--authenticationDatabase <dbname>
Read now
Unlock full access