Docs Menu

Docs HomeMongoDB Manual

Authenticate a User

To authenticate as a user, you must provide a username, password, and the authentication database associated with that user.

Important

It is not possible to switch between users in the same mongosh session. Authenticating as a different user means the session has the privileges of both authenticated users. To switch between users exit and relaunch mongosh.

Using mongosh, you can:

For examples using a MongoDB driver, see the driver documentation.

←  Create a UserList Users →