Module @mdf.js/mongo-provider

@mdf.js/mongo-provider

Node Version Typescript Version Known Vulnerabilities Documentation

netin

MongoDB Provider for @mdf.js/mongo-provider

Mytra Development Framework - @mdf.js

MongoDB provider for @mdf.js based on mongodb.

Using npm:

npm install @mdf.js/mongo-provider

Using yarn:

yarn add @mdf.js/mongo-provider

Check information about @mdf.js providers in the documentation of the core module @mdf.js/core.

Checks included in the provider:

  • status: Checks the status of the MongoDB nodes using the heartbeat events from the client.
    • observedValue: actual state of the consumer/producer provider instance [error, running, stopped] based in the last heartbeat event. stopped if the provider is stopped or has not been initialized yet, running if the provider is running and the last heartbeat event was successful, error if the provider is running and the last heartbeat event was not successful.
    • observedUnit: status.
    • status: fail if the observed value is error, warn if the observed value is stopped, pass in other case.
  • heartbeat:
    • observedValue: failed if the last heartbeat was not successful, heartbeat information if the last heartbeat was successful.
    • observedUnit: heartbeat result.
    • status: fail if the observed value is failed, pass in other case.
    • output: shows the connection identifier and the failure message in case of failed state (status fail). undefined in other case.
  • lastCommand:
    • observedValue: succeeded if the last command executed in the provider was successful, failed if the last command executed in the provider failed.
    • observedUnit: command result.
    • status: pass if the observed value is succeeded, fail if the observed value is failed.
    • output: Shows the command name and the command failure message in case of failed state (status fail). undefined if the observed value is succeeded.
  • lastFailedCommands:
    • observedValue: Shows the last 10 failed commands executed in the provider, each entry shows the date of the command in ISO format, the command name and the failure message.
    • observedUnit: last failed commands.
    • status: pass.
    • output: undefined.
  • CONFIG_MONGO_URL (default: `mongodb://127.0.0.1:27017/mdf`): URL for the mongo database
  • CONFIG_MONGO_CA_PATH (default: undefined): Path to the CA for the mongo database
  • CONFIG_MONGO_CERT_PATH (default: undefined): Path to the cert for the mongo database
  • CONFIG_MONGO_KEY_PATH (default: undefined): Path to the key for the mongo database

Copyright 2024 Mytra Control S.L. All rights reserved.

Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.

Namespaces

Mongo