So I'm facing the problem where I'm not getting proper data from a database. My database is successfully connected. As a result I'm getting the empty array of data.
Here is what I'm trying to fetch:
app.get('/user', async (req,res) => {
let db = await connect()
let cursor = await db.collection("user").find({})
let finalData = await cursor.toArray();
res.json(finalData);
})