How to get results from `Collection.find()` in mongodb?

Viewed 147

I successfully connected MongoDB to my Deno API Application. I added todos from my post request from the postman. When I try to get all the Todos from the get request I'm getting this {}. what went wrong here?

//get todo
const getTodo = async (ctx: RouterContext) => {
  const notes = await notesCollection.find();
  ctx.response.body = notes;
  console.log(notes);
};

My Console output is FindCursor {}

0 Answers
Related