File

lib/health-indicators/database/mongoose.health.ts

Description

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

Extends

HealthIndicator

Example

Index

Methods

Constructor

constructor(moduleRef: ModuleRef)

Initializes the MongooseHealthIndicator

Parameters :
Name Type Optional Description
moduleRef ModuleRef No

The NestJS module reference

Methods

Public Async pingCheck
pingCheck(key: string, options: MongoosePingCheckSettings)

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

Parameters :
Name Type Optional Default value Description
key string No

The key which will be used for the result object

options MongoosePingCheckSettings No {}

The options for the ping

Example :
mongooseHealthIndicator.pingCheck('mongodb', { timeout: 1500 });
Protected getStatus
getStatus(key: string, isHealthy: boolean, data?: literal type)

Generates the health indicator result object

Parameters :
Name Type Optional Description
key string No

The key which will be used as key for the result object

isHealthy boolean No

Whether the health indicator is healthy

data literal type Yes

Additional data which will get appended to the result object

result-matching ""

    No results matching ""