Database

mdxWebApiCore.Utils. Database

Class which defines Database

Constructor

new Database(input)

Description:
  • Constructor is passed a destructured object as param.
Source:
Parameters:
Name Type Description
input Object Input object.
Properties
Name Type Description
name string
client Object Database client
configs Map

Methods

getClient() → {Object}

Description:
  • returns the database client.
Source:
Example
const mdx = require("@nvidia-mdx/web-api-core");
const elastic = new mdx.Utils.Elasticsearch({node: "elasticsearch-url"},databaseConfigMap);
let databaseClient = elastic.getClient();
Returns:
Type
Object

getConfigs() → {Map}

Description:
  • returns the database configs.
Source:
Example
const mdx = require("@nvidia-mdx/web-api-core");
const elastic = new mdx.Utils.Elasticsearch({node: "elasticsearch-url"},databaseConfigMap);
let databaseConfigs = elastic.getConfigs();
Returns:
Type
Map

getName() → {string}

Description:
  • returns the database name.
Source:
Example
const mdx = require("@nvidia-mdx/web-api-core");
const elastic = new mdx.Utils.Elasticsearch({node: "elasticsearch-url"},databaseConfigMap);
let databaseName = elastic.getName();
Returns:
Type
string