Skip to main content

Database

@jbkr/db-client

Client for databases in the jbkr cluster in MongoDB Atlas.

Source: modules/db-client/index.js

API

Public : Function :

returnDatabaseConnection

Return a MongoDB Client connected to the specified database in the MongoDB Atlas jbkr cluster.

Type Definitions

Parameters

NameTypeDescription
{}ObjectDestructured parameters
{}.dbNameObjectName of database to which to connect.

Return

Returns: MongoDBClient — A MongoDB Client connected to the specified database in the MongoDB Atlas jbkr cluster.

Examples

import { returnDatabaseConnection } from '@jbkr/db-client';

const dbConnection = await returnDatabaseConnection({
'dbName': process.env.mongoDbDbName,
});
const data = await dbConnection.collection('collectionName').findOne({});

Source: modules/db-client/index.js:53

Inner Elements

Private : Function :

returnMongoConnection

Return a MongoDB Client connected to the MongoDB Atlas jbkr cluster.

Type Definitions

Return

Returns: MongoDBClient — A MongoDB Client connected to the MongoDB Atlas jbkr cluster.

Source: modules/db-client/index.js:28