I’ve added a few documents to the MongoDB database but I am unable to log them using the console. By just using Fruit.find() and logging it to the terminal, log() produces nothing. I tried reading Mongoose documentation but I didn’t find any solution.
It is because of the asynchronous type of DB calls. We can use then() along with find() to handle this situation.