Mongodb – I'm getting an error while creating api with the data I pulled from the database
I want to make a ".json" page with the data I pulled. ut Code app.get("/:user_id", async (req, res) => { let items = []; await msgData.find({ userId: req.params.user_id }).then((e) => { e.map((e) => { for (const [key, value] of e.msgChannelsMsgCount.entries())…