Book Image

Node Web Development - Second Edition

By : David Herron
Book Image

Node Web Development - Second Edition

By: David Herron

Overview of this book

Table of Contents (17 chapters)
Node Web Development Second Edition
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
Index

Storing notes in MongoDB with Mongoose


MongoDB is one of the leading NoSQL databases. They describe it as a scalable, high performance, open source, document-oriented database. It uses JSON-style documents with no predefined rigid schema, and a large number of advanced features. You can see their website for more information and documentation: http://www.mongodb.org.

A prerequisite is to have a MongoDB instance available. If you do not have access to one, mongohosting (http://www.mongohosting.com), mongohq (http://www.mongohq.com), and mongolab (http://www.mongolab.com) all offer a free pricing tier to use on a trial basis.

Mongoose is one of several modules for accessing MongoDB from Node. It is an object modeling tool, meaning that your program defines schema objects describing its data, and Mongoose takes care of storage in MongoDB. It's a very powerful object modeling tool for Node and MongoDB, with embedded documents, a flexible typing system for fields, field validation, virtual fields...