IntelliJ IDEA
 
Get IntelliJ IDEA
You are viewing the documentation for an earlier version of IntelliJ IDEA.

MongoDB

Last modified: 10 August 2022

In MongoDB, for authentication, you must provide a username, password, and the authentication database that is associated with this username. If the authentication database differs from the database to which you want to connect, specify the authentication database with the authSource parameter in the URL. If no authentication database is specified, MongoDB uses the admin database by default.

For example, you want to connect to the local database but your authentication database is admin. In this case, the connection URL will look like: mongodb://localhost:27017/local?authSource=admin.