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
Post a Comment