Create the MongoManager
public class Application {
public static void main(String[] args) {
MongoManager manager = new MongoManager();
}
}en2do.connectString=mongodb://<username>:<password>@<host>:<port>/?<options>
en2do.database=<database>public class Application {
public static void main(String[] args) {
Credentials credentials;
// Loading properties from resources file /resources/credentials.properties
credentials = Credentials.fromResource();
// Loading properties erty from resources file of given path
credentials = Credentials.fromResource("/path/to/resources.properties");
// Loading properties from the file-storage {jar-directory}/credentials.properties
credentials = Credentials.fromFile();
// Loading properties from the file-storage of given path
credentials = Credentials.fromFile("/path/to/file.properties");
// Loading the properties from the system properties
credentials = Credentials.fromSystemProperties();
// Loading the properties from the system properties,
// using custom keys
credentials = Credentials.fromSystemProperties("CONNECT_KEY", "DATABASE_KEY");
// Keys are "EN2DO_CONNECTSTRING" and "EN2DO_DATABASE"
// Loading the properties from the system environmental variables
credentials = Credentials.fromSystemEnvVars();
// Loading the properties from the system environmental variables,
// using custom keys
credentials = Credentials.fromSystemEnvVars("CONNECT_KEY", "DATABASE_KEY");
// Creating credentials with strings.
credentials = Credentials.of("connectString", "database");
}
}Last updated