Chapter 6. Interacting with Data – Reading, Querying, and Finding
So we've seen how Mongoose provides simple static methods for adding data to the database. Now let's see what Mongoose offers to help us find the data we want by querying the database and reading the data back into model instances in our application.
In this chapter we will:
- Learn about the built-in options for querying MongoDB through Mongoose
- Get practical by updating our application, letting us find individual users, individual projects and lists of projects
- Extend on the default functionality by creating our own static method
Approaches to find and read data
Mongoose offers many ways of querying data, but much like what we saw in Chapter 5, Interacting with Data – Creation, there ...