# Module: vertx-service-discovery-js/mongo_data_source

### Classes

MongoDataSource

### Methods

#### (static) MongoDataSource.createRecord(name, location, metadata) → {Object}

Convenient method to create a record for a Mongo data source.

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | the service name
`location` | Object | the location of the service (e.g. url, port...)
`metadata` | Object | additional metadata

Source:
  - vertx-service-discovery-js/mongo_data_source.js, line 70

##### Returns:

the created record

Type
  Object

#### (static) MongoDataSource.getMongoClient(discovery, filter, consumerConfiguration, resultHandler)

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

##### Parameters:

Name | Type | Description
--- | --- | ---
`discovery` | ServiceDiscovery | The service discovery instance
`filter` | Object | The filter, optional
`consumerConfiguration` | Object | the consumer configuration
`resultHandler` | function | the result handler

Source:
  - vertx-service-discovery-js/mongo_data_source.js, line 87