Class MongoClients
java.lang.Object
com.mongodb.reactivestreams.client.MongoClients
A factory for MongoClient instances.
- 
Method SummaryModifier and TypeMethodDescriptionstatic MongoClientcreate()Creates a new client with the default connection string "mongodb://localhost".static MongoClientcreate(ConnectionString connectionString) Create a new client with the given connection string.static MongoClientcreate(ConnectionString connectionString, MongoDriverInformation mongoDriverInformation) Create a new client with the given connection string.static MongoClientcreate(MongoClientSettings settings) Create a new client with the given client settings.static MongoClientcreate(MongoClientSettings settings, MongoDriverInformation mongoDriverInformation) Creates a new client with the given client settings.static MongoClientCreate a new client with the given connection string.static CodecRegistryGets the default codec registry.
- 
Method Details- 
createCreates a new client with the default connection string "mongodb://localhost".- Returns:
- the client
 
- 
createCreate a new client with the given connection string.- Parameters:
- connectionString- the connection
- Returns:
- the client
 
- 
createCreate a new client with the given connection string.- Parameters:
- connectionString- the settings
- Returns:
- the client
 
- 
createpublic static MongoClient create(ConnectionString connectionString, @Nullable MongoDriverInformation mongoDriverInformation) Create a new client with the given connection string.Note: Intended for driver and library authors to associate extra driver metadata with the connections. - Parameters:
- connectionString- the settings
- mongoDriverInformation- any driver information to associate with the MongoClient
- Returns:
- the client
- Since:
- 1.3
 
- 
createCreate a new client with the given client settings.- Parameters:
- settings- the settings
- Returns:
- the client
- Since:
- 1.8
 
- 
createpublic static MongoClient create(MongoClientSettings settings, @Nullable MongoDriverInformation mongoDriverInformation) Creates a new client with the given client settings.Note: Intended for driver and library authors to associate extra driver metadata with the connections. - Parameters:
- settings- the settings
- mongoDriverInformation- any driver information to associate with the MongoClient
- Returns:
- the client
- Since:
- 1.8
 
- 
getDefaultCodecRegistryGets the default codec registry.- Returns:
- the default codec registry
- Since:
- 1.4
- See Also:
 
 
-