Summary

In this chapter, we have learned how to query MongoDB through Mongoose by returning single instances and arrays of instances. We have seen how to run quick single command operations and also how to build more complex queries.

We have added a number of different approaches to our MongoosePM project, which includes returning JSON directly to an AJAX request. On top of all of this we have used the ability of Mongoose to create custom static methods to make it easy to get exactly what we want.

In the next chapter, we are going to take a look at updating data, so that we can allow users to change their profiles and projects.

Get Mongoose for Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.