Mongodb

libs.mongodb.get().connect()

Requires the MongoDB integration to be set up
Returns an instance of mongodb service instance.
1
// get connection
2
const client = await libs.mongodb.get().connect();
3
​
4
// get collection
5
const db = client.db('db_name');
6
const collection = db.collection('collection_name');
7
​
8
// do what you want...
9
​
10
// to close connection
11
await client.close();
Copied!
Last modified 9mo ago
Copy link