Mongodb

libs.mongodb.get().connect()

Requires the MongoDB integration to be set up

Returns an instance of mongodb service instance.

// get connection
const client = await libs.mongodb.get().connect();

// get collection
const db = client.db('db_name');
const collection = db.collection('collection_name');

// do what you want...

// to close connection
await client.close();

Last updated