vertx / io.vertx.kotlin.servicediscovery.types / MongoDataSource / getMongoClientAwait

# getMongoClientAwait

`suspend fun getMongoClientAwait(discovery: ServiceDiscovery, filter: JsonObject): MongoClient`

Convenient method that looks for a Mongo datasource source and provides the configured io.vertx.ext.mongo.MongoClient. The async result is marked as failed is there are no matching services, or if the lookup fails.

### Parameters

`discovery` - The service discovery instance

`filter` - The filter, optional

`suspend fun getMongoClientAwait(discovery: ServiceDiscovery, filter: Function<Record, Boolean>): MongoClient`

Convenient method that looks for a Mongo datasource source and provides the configured io.vertx.ext.mongo.MongoClient. The async result is marked as failed is there are no matching services, or if the lookup fails.

### Parameters

`discovery` - The service discovery instance

`filter` - The filter

`suspend fun getMongoClientAwait(discovery: ServiceDiscovery, filter: JsonObject, consumerConfiguration: JsonObject): MongoClient`

Convenient method that looks for a Mongo datasource source and provides the configured io.vertx.ext.mongo.MongoClient. The async result is marked as failed is there are no matching services, or if the lookup fails.

### Parameters

`discovery` - The service discovery instance

`filter` - The filter, optional

`consumerConfiguration` - the consumer configuration