const { MongoClient } = require('mongodb');
const client = new MongoClient(process.env.MONGODB_URI);
await client.connect();
const db = client.db('shop');
const users = await db.collection('users').find().toArray();Connecting from Node.js
The official mongodb npm driver is the standard way to talk to MongoDB from a Node.js application.