Skip to content

Learners Store

  • Home
  • JavaScript
  • Javascript Coding Questions
  • ReactJS
  • Redux-Saga
  • React Native
  • System Design
  • GraphQL
  • GraphQL Interview Questions
  • Motivation
  • Contact

Tag: Mongoose

Mongoose Model.find() method with query parameter.

We can use query parameter with Model.find() method as follows.

userRouter.route('/users').get((req, res) => {
const { query } = req;
Users.find(query).then((err, books) => {
if(err){
return res.send(err)
}
return res.json(books)
});
})
Posted on January 10, 2024Tags Mongoose, NodeJSLeave a comment on Mongoose Model.find() method with query parameter.
Blog at WordPress.com.
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Subscribe Subscribed
    • Learners Store
    • Already have a WordPress.com account? Log in now.
    • Learners Store
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar