8. Databases I: NoSQL (MongoDB)

Now that you have a solid foundation for your web application and are fully set up with the express web application framework and Mustache templating, you are ready to spend a couple of chapters adding a back end to it. In these next two chapters, you look at two common ways this is done. You start in this chapter by looking at a popular NoSQL database called MongoDB, which provides a quick and easy way to serialize JSON data directly to a database. This chapter covers the basics of using it, and then you update your album handler to let you store album and photo data to the database.

I chose to work with MongoDB instead of other popular NoSQL databases—in particular, CouchDB—because it’s particularly easy to use ...

Get Learning Node.js: A Hands-On Guide to Building Web Applications in JavaScript now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.