In this episode, I'll show you the basics of working with MongooseJS – an object document mapper for NodeJS. Mongoose allows you to quickly and easily define models and schemas that can be used for storing, modifying and retrieving documents in MongoDB.
Wait, hold on a second… these are documents in a document database, right? This isn't a relational database model, so why do we have a “schema” to work with? It turns out the Mongoose idea of a Schema isn't quite what a relational model has, though it is similar. In the end, though, the Mongoose idea of a schema is quite powerful and allows you to do some very interesting things to make your life easier, as a developer.