Package com.mongodb.embedded.client
Class MongoClients
- java.lang.Object
-
- com.mongodb.embedded.client.MongoClients
-
public final class MongoClients extends Object
A factory forMongoClient
instances.- Since:
- 3.8
- See Also:
MongoClient
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
close()
Closes down the mongod librarystatic MongoClient
create(MongoClientSettings mongoClientSettings)
Creates a new client.static void
init(MongoEmbeddedSettings mongoEmbeddedSettings)
Initializes the mongod library for use.
-
-
-
Method Detail
-
init
public static void init(MongoEmbeddedSettings mongoEmbeddedSettings)
Initializes the mongod library for use.The library must be called at most once per process before calling
create(MongoClientSettings)
.- Parameters:
mongoEmbeddedSettings
- the settings for the embedded driver.
-
create
public static MongoClient create(MongoClientSettings mongoClientSettings)
Creates a new client.- Parameters:
mongoClientSettings
- the mongoClientSettings- Returns:
- the client
-
close
public static void close()
Closes down the mongod library
-
-