Mongodb – MongooseError: Model.findOne() no longer accepts a callback
Consider: app.get("/posts/:postId", function(req, res) { const requestedPostId = req.params.postId; Post.findOne({_id: requestedPostId}, function(err, post) { res.render("post", { title: post.title, content: post.content }); }); }); This is what used to work for me, using Express.js and Mongoose. How can I fix it?