MongooseHealthIndicator

The MongooseHealthIndicator contains health indicators which are used for health checks related to Mongoose

  
class MongooseHealthIndicator {
  pingCheck<Key extends string = string>(key: Key, options: MongoosePingCheckSettings = {}): Promise<HealthIndicatorResult<Key>>
}

Methods

pingCheck()

Checks if the MongoDB responds in (default) 1000ms and returns a result object corresponding to the result


pingCheck<Key extends string = string>(key: Key, options: MongoosePingCheckSettings = {}): Promise<HealthIndicatorResult<Key>>

Parameters

Option Type Description
key Key

The key which will be used for the result object

options MongoosePingCheckSettings

The options for the ping


Optional. Default is `{}`.

Examples

    
mongooseHealthIndicator.pingCheck('mongodb', { timeout: 1500 });

Returns

Promise<HealthIndicatorResult<Key>>