How to Connect to MongoDb

Read first the Connection dialog page to understand the dialog fields( host, port, user, etc. ), SSH tunnel, etc. For a detailed list of MongoDb features read this page.

DbSchema can connect to MongoDb using the native MongoDb Java URI. In the connection dialog 'JDBC URL' tab you can enter the same URI you would use from any Java application to connect. DbSchema created a JDBC driver for MongoDb on top of the existing Java native driver. You can also create a connection entering a host, port, etc. as described in 'Connect Using the Dialog Fields'.

Tip You may connect to multiple servers or with different settings by choosing in Connection Dialog the 'Advanced' tab / Custom URL and use parameters as in . Please open this link in an web browser. We are passing the URL to the native MongoDb Java driver.

Connect Using MongoDb Native URI

You can connect using the same URI as in MongoDb documentation. Just enter this URI in DbSchema 'Advanced' tab and 'Custom URL'. You may connect to multiple hosts and use custom parameters. DbSchema JDBC driver is using the native MongoDb Java driver as described on .
Custom URL

Tip DbSchema features for MongoDb are explained in detail on as well as in the tutorials available on the same website, the tutorials page.

Connect Using the Dialog Fields

To connect to MongoDb you should first start from command prompt the mongod.exe process located in the MongoDb installation directory.

In the connection dialog you can enter the host, port, user and password ( by default not required ). From the Driver combo you can choose between connecting without authentication and with authentication.

The connection without authentication is the default one, unless you or an admin have set authentication on the server.


Connect to MongoDb Atlas Cloud

In Atlas choose 'Clusters' / 'Connect' and look for the Java URI connection string. Copy this value in the 'JDBC URL' tab in DbSchema ( first tick the Use Custom URL checkbox ). This is the same procedure as in the Connect Using native Java URI chapter. For simplicity you can edit and use in the URI only the first server ( the URI contains a list of 3 servers ).

How to setup authentication in MongoDb server

To setup authentication in MongoDb follow this steps:
  1. Create the user in database:
    use admin
        user: "test",
        pwd: "test",
        roles: [ { role: "root", db: "admin" } ]
  2. Create a file mongo.config in the MongoDB installation folder. Edit to
    # Basic database configuration
    dbpath = C:\data\db
    bind_ip =
    port = 27017
    # Security
    auth = true
    # Administration & Monitoring
    nohttpinterface = true
  3. Start the mongodemon using mongod.exe -f mongo.config. You can text the connection using mongo.exe --port 20571 -u test -p test --host admin .