create

fun create(): MongoClient

Creates a new client with the default connection string "mongodb://localhost".

Return

the client


fun create(connectionString: String): MongoClient

Create a new client with the given connection string.

Return

the client

Parameters

connectionString

the connection


fun create(connectionString: ConnectionString): MongoClient

Create a new client with the given connection string.

Return

the client

Parameters

connectionString

the settings


fun create(connectionString: ConnectionString, mongoDriverInformation: MongoDriverInformation?): MongoClient

Create a new client with the given connection string.

Note: Intended for driver and library authors to associate extra driver metadata with the connections.

Return

the client

Since

1.3

Parameters

connectionString

the settings

mongoDriverInformation

any driver information to associate with the MongoClient


fun create(settings: MongoClientSettings): MongoClient

Create a new client with the given client settings.

Return

the client

Since

3.7

Parameters

settings

the settings


fun create(settings: MongoClientSettings, mongoDriverInformation: MongoDriverInformation?): MongoClient

Creates a new client with the given client settings.

Note: Intended for driver and library authors to associate extra driver metadata with the connections.

Return

the client

Since

3.7

Parameters

settings

the settings

mongoDriverInformation

any driver information to associate with the MongoClient