create

fun create(connectionString: String): MongoClient

Create a new client with the given connection string as if by a call to create.

Return

the client

Parameters

connectionString

the connection


fun create(connectionString: ConnectionString = ConnectionString("mongodb://localhost"), @Nullable mongoDriverInformation: MongoDriverInformation? = null): MongoClient

Create a new client with the given connection string.

Return

the client

Parameters

connectionString

the connection string, defaults to mongodb://localhost.

mongoDriverInformation

any driver information to associate with the MongoClient


fun create(settings: MongoClientSettings, @Nullable mongoDriverInformation: MongoDriverInformation? = null): MongoClient

Create a new client with the given connection string.

For each of the settings classed configurable via MongoClientSettings, the connection string is applied by calling the applyConnectionString method on an instance of setting's builder class, building the setting, and adding it to an instance of com.mongodb.MongoClientSettings.Builder.

Return

Parameters

settings

the client settings

mongoDriverInformation

any driver information to associate with the MongoClient