Analogously to other connections in CloverDX, MongoDB connections can be created as both internal and external. See sections Creating Internal Database Connections and Creating External (Shared) Database Connections to learn how to create them. Definition process for MongoDB connections is very similar to other connections, just select Create MongoDB connection instead of Create DB connection.
Figure 33.12. MongoDB Connection Dialog
From the connection properties, Connection Name, Host(s) and Database Instance are mandatory.
In this field, type a name you want for this connection. Note that if you are creating a new connection, the connection name you enter here will be used to generate an ID of the connection. Whereas the connection name is just an informational label, the connection ID is used to reference this connection from various graph components. Once the connection is created, the ID cannot be changed using this dialog to avoid accidental breaking of references (if you really want to change the ID of already created connection, you can do so in the Properties view).
Enter the host name (or IP address) and port number in the form
If the port number is not specified, the default port 27017 will be used.
If you need to connect to a replica set or a cluster, enter a comma-separated list of hosts.
The user name used for authentication.
The password used for authentication.
The name of the MongoDB database to connect to. The database is also used for authentication by default, this can be changed with the Authentication Database property (see below).
The database used for authentication. If not filled in, the working database is used as an authentication database.
Enables SSL encryption
Disables the validations of certificates. Useful with self-signed certificates.
Figure 33.13. MongoDB Connection Dialog - Advanced Tab
This table allows you to fine-tune some MongoDB parameters. Usually, leaving it empty is just fine.
The list of available options depends on the version of the driver library used.
See com.mongodb.MongoClientOptions.Builder if you use driver version 2.10.0 or newer. The options have the same names as the setter methods of the class.
For older driver versions, see com.mongodb.MongoOptions of the respective version. The options have the same names as the fields of the class.
Optional. By default, an embedded driver will be used for the connection.
Usually, you don't need to provide a custom driver library, because the Java driver versions should be backwards compatible.
The paths to the driver library can be absolute or project relative. Graph parameters can be used as well.
Note that even though the connector tries to maximize backward compatibility,
using an outdated version of the driver library
may lead to
java.lang.NoSuchMethodError being thrown.
The connection has primarily been tested with the embedded driver version 2.11.0, it should work with newer driver versions as well. It has also been successfully tested with prior driver versions up to 2.3, but the functionality may be limited.
|Usage on the CloverDX Server|
If you do define the library paths, note that absolute paths are absolute paths on the application server. Relative paths are sandbox (project) relative and will work only if the library is located in a shared sandbox.
Once you've finished setting up your MongoDB connection, click the CloverDX Server sandbox.button to verify that the parameters you entered can be used to successfully establish a connection. Note that connection validation is unfortunately not available if the driver library is located in (remote)
 MongoDB is a trademark of MongoDB Inc.