NOVA MEAN - Why the M in MEAN is a Significant Contributor to Its Success
1. Why the M in MEAN is a Significant
Contributor to Its Success
Presentation to NOVA Mean March 18, 2014
Jonathan M. Altman
jonathan@async.io | @async_io
https://async.io/ | https://github.com/jonathana
Tuesday, March 18, 2014
2. Me
•Founder, Async IO and InTheBin
•node.dc co-organizer
•Semi-regular speaker
•https://github.com/jonathana
•http://www.slideshare.net/async_io
Tuesday, March 18, 2014
3. I Have Never Given This
Presentation
Tuesday, March 18, 2014
4. 4th Time Doing This Talk
•MongoDC 2011
•MongoDC 2012
•DevIgnition 2013
•NOVA Mean March, 2014
Tuesday, March 18, 2014
5. MongoDC 2011
•Node.js is cool
•It works well with Mongo
•Mongoose is available, but may not be buying you that much for
the overhead
•Showed with expressjs
Tuesday, March 18, 2014
6. MongoDC 2012
•MongoDB and nodejs are a productive combo for building apps
•With Express
•Mongoose is an easy choice
•Everyauth is a great way to do authentication
•Starter skeleton app
Tuesday, March 18, 2014
7. Then This Happened
•Valeri Karpov posted “The MEAN Stack: MongoDB, ExpressJS,
AngularJS and Node.js” in April 2013
•http://blog.mongodb.org/post/49262866911/the-mean-stack-
mongodb-expressjs-angularjs-and
Tuesday, March 18, 2014
8. DevIgnition 2013
•MEAN has “arrived”
•Covered a lot of why it is great, including the MongoDB part
•Did not get to show as much of the talk as I wanted, specifically
code
Tuesday, March 18, 2014
9. So Why Is Mongo Significant?
Tuesday, March 18, 2014
10. The “M” in MEAN
•M - MongoDB
•E - ExpressJS
•A - AngularJS
•N - Node.js
JSON(BSON)-
oriented noSQL
database engine
Tuesday, March 18, 2014
11. M is for MongoDB
•noSQL data storage engine
•Scalable, adaptable
•Document store of JSON (BSON)
data
•Fidelity: Angular, nodeJS, and
MongoDB all “speak” JSON
Tuesday, March 18, 2014
12. M is for MongoDB
•MongoDB database contains collections (tables)
•Collections contain BSON documents (“rows”),
but they are really documents
•Documents can nest other documents
•Documents in a collection can all have different
BSON keys in them
Tuesday, March 18, 2014
13. M is for MongoDB
[user@host ~]$ mongo
MongoDB shell version: 2.2.0
connecting to: test
> use campaign
switched to db campaign
> db.campaignusers.find({email:
"jonathan@recycli.st"})
{ "fullName" : "Jonathan", "email" :
"jonathan@recycli.st", "_id" : ObjectId
("50a40e11ea84d53c42000005"), "addMarketing" :
true, "__v" : 0 }
Tuesday, March 18, 2014
14. M Is Also For Mongoose
•Object Data Mapper (ODM) for MongoDB
•Costs some of the flexibility of the MongoDB
document store
•Start by using it
Tuesday, March 18, 2014
15. Put It Together and... MEAN it!
•Yeoman provides a great set of tools to get started
•There are also a bunch of seed repositories on
github to use. Google “MEAN github seed”
•Consider https://github.com/DaftMonk/generator-
angular-fullstack
•Wire in MongoDB
Tuesday, March 18, 2014
20. Resources - MongoDB, Angular
• MongoDB Inc. post referencing MEAN: http://blog.mongodb.org/post/49262866911/the-mean-stack-
mongodb-expressjs-angularjs-and
• MongoDB: http://www.mongodb.org/ and the company behind MongoDB is at http://http://
www.mongodb.com/
• BSON: http://bsonspec.org/
• Mongoose: http://mongoosejs.com/
• AngularJS: http://angularjs.org/ and their tutorial at http://docs.angularjs.org/tutorial is highly recommended
• Slides from a talk at AngularDC on “Angular from Scratch”: http://www.slideshare.net/xmlilley/angular-
from-scratch
Tuesday, March 18, 2014
21. Resources - nodeJS, HTML5
• nodeJS: http://nodejs.org/
• npm (node package manager): https://npmjs.org/
• ExpressJS: http://expressjs.com/
• Good resource on technologies in HTML5: http://www.html5rocks.com/en/
Tuesday, March 18, 2014