I\'m using MongoDB 3.2 in my application. The code below demonstrates database initialization logic:
private void dbInit(String dbName) { String mongoCl
As MarkusWMahlberg correctly noted, it is necessary to note the database name in the connection string.
For instance:
String mongoClientURI = "mongodb://" + DB_SRV_USR + ":" + DB_SRV_PWD + "@" + DB_URL + ":" + DB_PORT + "/" + dbName;