Summary

In this chapter, we have learned how to modify existing data using Mongoose. We have seen that there are some very simple methods we can use, but that this simplicity comes at a price. The price in this case is that defaults, validation, and middleware are not applied. We have also seen that we can use a more traditional three-step find-edit-save approach within Mongoose.

Following this theory we moved onto the practice and added to our MongoosePM project, making user and project information updatable, and updated the login script to record a timestamp of when the user logged in.

Coming up in the next chapter we will be learning about the last of the four CRUD cornerstones, deletion.

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.