Why won't my get route run my mongoose query? Why won't my get route run my mongoose query? mongoose mongoose

Why won't my get route run my mongoose query?


const user = await User.find({ _id: req.params });

req.params is an object and you'll need to extract the id you want to pass to your query.

Here's an example of how to destructure your object. You may need to adjust the assignment to match the property name.

const { id } = req.params;