Mongoose


@eschoff - @funkytek - @wearefractal

Consulting, training, products, professional services

contact@wearefractal.com

Open source is at github.com/wearefractal

Before we get started...


If you don't have MongoDB and Node.JS installed

DO IT NOW

MongoDB


  • It's a database
  • It stores documents
  • Documents are JSON

 db.employees.find({name: "Todd"}) // Get employee by name

All Aboard the Hype Train


Mongo is good at storing documents.

Don't try to use it as a relational database.

Don't try to use it for pubsub.

Use it to store documents.

Mongoose


  • Validation logic
  • Relationships
  • Connection management
  • Middleware
  • Chainable queries
  • Plugins

 Employee.find({name: "Todd"}) // Get employee by name

and most importantly...






Sugar











Workshop


sudo npm install mongoose-adventure -gmongoose-adventure setupmongoose-adventure
Skip the setup command and run mongod --port 9001 if you are on Windows

Some of the verification is not working on Windows

Documentation for Mongoose = http://mongoosejs.com/docs/

Raise a fist in the air when you complete a lesson

If you complete all of the lessons you get a treat
Made with Slides.com