Digital Marketing

Fixed MongoClient is abstract; cannot be instantiated

You can instantiate a MongoClient object without any parameters to connect to a MongoDB instance running on localhost on port 27017:

MongoClient mongoClient = MongoClients.create();
Or you can specify the ConnectionString:

MongoClient mongoClient = MongoClients.create("mongodb://hostOne:27017,hostTwo:27018");

Comments

Popular posts from this blog

Fixed WSL sshd: no hostkeys available -- exiting

PowerMTA pmta command

How to fix: mv: failed to preserve ownership