SlideShare a Scribd company logo
1 of 90
Download to read offline
MongoDB + Node.js
Building first app with MongoDB and Node.js
2
Agenda
MongoDB + Node.js
Driver
ODM's
MEAN Stack
Meteor
3
Ola, I'm Norberto!
Norberto Leite
Technical Evangelist
Madrid, Spain
@nleite
norberto@mongodb.com
http://www.mongodb.com/norberto
MongoDB Node.js
INFACT
MongoDB JavaScript
7
Few reasons why
Flexible Agile
Web
Language
8
MongoDB + Javascript
•  MongoDB Shell
–  JS interperter
•  MongoDB MapReduce
–  Runs on top of V8
–  Map and Reduce functions are JS functions
•  Native support for Node.js
–  One of the most used Drivers out there!
–  https://www.npmjs.com/package/mongodb
Node.js
10
2 Foundations
Events Streams
11
2 Foundations
•  Events / Event Loop
–  Single Thread Applications
–  No threads
–  Events Emitter
–  Event Queue
–  Known Events
•  Streams
–  Read, Write, Both
–  Unix Pipes
–  We use it extensively!
Install
npm package
$ npm install mongodb
Compatibility
http://docs.mongodb.org/ecosystem/drivers/node-js/#compatibility
15
Compatibility w/ MongoDB
Initialize Project
package.json file
$ mkdir firstappnodejs
$ cd firstappnodejs
$ npm init
package.json file
$ mkdir firstappnodejs
$ cd firstappnodejs
$ npm init
...
{
"name": "firstappnodejs",
"version": "0.0.1",
"description": "Small demo webinar application",
"main": "index.js",
"scripts": {
"test": "workitout"
},
"repository": {
"type": "git",
"url": "git://github.com/nleite/firstappnodejs"
},
"dependencies": {
"mongodb": "~2.0"
},
"keywords": [http://docs.mongodb.org/ecosystem/drivers/node-js/#compatibility
"demo",
"nodejs",
"mongodb"
],
"author": "Norberto Leite",
"license": "Apache 2.0",
"bugs": {
"url": "https://github.com/nleite/firstappnodejs/issues"
},
"homepage": "https://github.com/nleite/firstappnodejs"
package.json file
$ mkdir firstappnodejs
$ cd firstappnodejs
$ npm init
...
{
"name": "firstappnodejs",
"version": "0.0.1",
"description": "Small demo webinar application",
"main": "index.js",
"scripts": {
"test": "workitout"
},
"repository": {
"type": "git",
"url": "git://github.com/nleite/firstappnodejs"
},
"dependencies": {
"mongodb": "~2.0"
},
"keywords": [
"demo",
"nodejs",
"mongodb"
],
"author": "Norberto Leite",
"license": "Apache 2.0",
"bugs": {
"url": "https://github.com/nleite/firstappnodejs/issues"
},
"homepage": "https://github.com/nleite/firstappnodejs"
Install our new firstappnodejs app!
$ npm install
> kerberos@0.0.10 install …
…
> bson@0.3.1 install
> mongodb@2.0.28 node_modules/mongodb
├── readable-stream@1.0.31 (isarray@0.0.1, inherits@2.0.1,
string_decoder@0.10.31, core-util-is@1.0.1)
└── mongodb-core@1.1.25 (kerberos@0.0.10, bson@0.3.1)
firstappnodejs/ $ ls
node_modules package.json
Connect
boot up MongoDB Server
$ mkdir ~/firstappdb
$ mongod --dbpath ~/firstappdb
boot up MongoDB Server
$ mkdir ~/firstappdb
$ mongod --dbpath ~/firstappdb --auth
--keyfile ~/n.pem
https://www.mongodb.com/products/mongodb-enterprise-advanced
boot up MongoDB Server
$ mkdir ~/firstappdb
$ mongod --dbpath ~/firstappdb --auth
--keyfile ~/n.pem
https://www.mongodb.com/products/mongodb-enterprise-advanced
var MongoClient = require('mongodb').MongoClient,
assert = require('assert');
Connect
var MongoClient = require('mongodb').MongoClient,
assert = require('assert');
//connection uri
var uri = "mongodb://localhost:27017/firstapp"
Connect
var MongoClient = require('mongodb').MongoClient,
assert = require('assert');
//connection uri
var uri = "mongodb://localhost:27017/firstapp"
//connect to MongoDB
MongoClient.connect(uri, function(err, db){
assert.equal(null, err);
console.log("Connected correctly to server");
db.close();
});
Connect
28
Connection Pooling
•  No traditional Pooling mechanism
–  Single thread process
•  Sockets to pipeline operations
•  Failover
–  Buffering up operations
–  bufferMaxEntries
–  numberOfRetries
–  retryMiliSeconds
http://mongodb.github.io/node-mongodb-native/2.0/api/Db.html
CRUD
var insertDocuments = function(db, cb){
//we don't need to explicitly create a collection
var collection = db.collection('myCollection');
collection.insertMany([
{"mongodb": "is just awesome"},
{"nodejs": "so awesome"}
], function(err, result){
assert.equal(null, err);
//inserted 2 documents
assert.equal(2, result.insertedCount);
//invoke callback
cb(result);
});
}
Insert
http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#insert
var insertDocuments = function(db, cb){
//we don't need to explicitly create a collection
var collection = db.collection('myCollection');
collection.insertMany([
{"mongodb": "is just awesome"},
{"nodejs": "so awesome"}
], function(err, result){
assert.equal(null, err);
//inserted 2 documents
assert.equal(2, result.insertedCount);
//invoke callback
cb(result);
});
}
Insert
http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#insert
var insertDocuments = function(db, cb){
//we don't need to explicitly create a collection
var collection = db.collection('myCollection');
collection.insertMany([
{"mongodb": "is just awesome"},
{"nodejs": "so awesome"}
], function(err, result){
assert.equal(null, err);
//inserted 2 documents
assert.equal(2, result.insertedCount);
//invoke callback
cb(result);
});
}
Insert
http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#insert
var insertDocuments = function(db, cb){
//we don't need to explicitly create a collection
var collection = db.collection('myCollection');
collection.insertMany([
{"mongodb": "is just awesome"},
{"nodejs": "so awesome"}
], function(err, result){
assert.equal(null, err);
//inserted 2 documents
assert.equal(2, result.insertedCount);
//invoke callback
cb(result);
});
}
Insert
http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#insert
MongoClient.connect(uri, function(err, db) {
assert.equal(null, err);
console.log("Sweet! Talking to Server");
insertDocuments(db, function() {
db.close();
});
});
Insert
http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#insert
MongoClient.connect(uri, function(err, db) {
assert.equal(null, err);
console.log("Sweet! Talking to Server");
insertDocuments(db, function() {
db.close();
});
});
Insert
http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#insert
var updateDocument = function(db, cb){
var collection = db.collection("myCollection");
collection.updateOne( {"mongodb": "is just awesome"},
{$set: {"users": ["nleite"]}}, function( err, result){
assert.equal(null, err);
assert.equal(1, result.modifiedCount);
console.log("Cool, just updated");
cb(result);
});
}
Update
http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#update
var updateDocument = function(db, cb){
var collection = db.collection("myCollection");
collection.updateOne( {"mongodb": "is just awesome"},
{$set: {"users": ["nleite"]}}, function( err, result){
assert.equal(null, err);
assert.equal(1, result.modifiedCount);
console.log("Cool, just updated");
cb(result);
});
}
Update
http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#update
var updateDocument = function(db, cb){
var collection = db.collection("myCollection");
collection.updateOne( {"mongodb": "is just awesome"},
{$set: {"users": ["nleite"]}}, function( err, result){
assert.equal(null, err);
assert.equal(1, result.modifiedCount);
console.log("Cool, just updated");
cb(result);
});
}
Update
http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#update
var updateDocument = function(db, cb){
var collection = db.collection("myCollection");
collection.updateOne( {"mongodb": "is just awesome"},
{$set: {"users": ["nleite"]}}, function( err, result){
assert.equal(null, err);
assert.equal(1, result.modifiedCount);
console.log("Cool, just updated");
cb(result);
});
}
Update
http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#update
MongoClient.connect(uri, function(err, db) {
assert.equal(null, err);
console.log("Ok, I can now update!");
updateDocuments(db, function() {
db.close();
});
});
Update
http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#update
Remove
var removeDocument = function(db, cb){
var collection = db.collection("myCollection");
collection.deleteOne( {"users": "nleite"},
function( err, result){
assert.equal(null, err);
assert.equal(1, result.deletedCount);
console.log("purged the @nleite contaminated
data!");
cb(result);
});
}
http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#remove
Remove
var removeDocument = function(db, cb){
var collection = db.collection("myCollection");
collection.deleteOne( {"users": "nleite"},
function( err, result){
assert.equal(null, err);
assert.equal(1, result.deletedCount);
console.log("purged the @nleite contaminated
data!");
cb(result);
});
}
http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#remove
Remove
var removeDocument = function(db, cb){
var collection = db.collection("myCollection");
collection.deleteOne( {"users": "nleite"},
function( err, result){
assert.equal(null, err);
assert.equal(1, result.deletedCount);
console.log("purged the @nleite contaminated
data!");
cb(result);
});
}
http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#remove
Remove
MongoClient.connect(uri, function(err, db) {
assert.equal(null, err);
console.log("Ok, I can now delete!");
removeDocuments(db, function() {
db.close();
});
});
http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#remove
Find
var findAllDocuments = function(db, cb){
var collection = db.collection('myDocuments');
//or collection.find()
collection.find({}).toArray(function(err, docs){
assert.equal(err, null);
assert.equal(1, docs.length);
console.log("Gotcha! found "+ docs.length);
console.dir(docs);
cb(docs);
});
}
http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#find
Find
var findAllDocuments = function(db, cb){
var collection = db.collection('myDocuments');
//or collection.find()
collection.find({}).toArray(function(err, docs){
assert.equal(err, null);
assert.equal(1, docs.length);
console.log("Gotcha! found "+ docs.length);
console.dir(docs);
cb(docs);
});
}
http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#find
Find
var findAllDocuments = function(db, cb){
var collection = db.collection('myDocuments');
//or collection.find()
collection.find({}).toArray(function(err, docs){
assert.equal(err, null);
assert.equal(1, docs.length);
console.log("Gotcha! found "+ docs.length);
console.dir(docs);
cb(docs);
});
}
http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#find
Flexibility
Schema Flexibility
Different Schemas
var insertDifferentShapes = function(db, cb){
var doc1 = {"name": "Norberto", "talks": [
{"nodejs":10}, {"java":15}, "python":11]};
var doc2 = {"name": "Bryan", "webinars": 30};
var coll = db.collection("content")
coll.insertMany( [doc1, doc2], function(err, result){
assert.equal(err, null);
assert.equal(2, result.insertedCount);
console.log("Sweet, inserted "+ result.insertedCount);
cb(result);
});
}
http://docs.mongodb.org/manual/data-modeling/
Different Schemas
var insertDifferentShapes = function(db, cb){
var doc1 = {"name": "Norberto", "talks": [
{"nodejs":10}, {"java":15}, "python":11]};
var doc2 = {"name": "Bryan", "webinars": 30};
var coll = db.collection("content")
coll.insertMany( [doc1, doc2], function(err, result){
assert.equal(err, null);
assert.equal(2, result.insertedCount);
console.log("Sweet, inserted "+ result.insertedCount);
cb(result);
});
}
http://docs.mongodb.org/manual/data-modeling/
WriteConcerns
WriteConcern w:1
WriteConcern w:2
WriteConcern j:true
Different WriteConcerns
var insertSuperImportant = function(db, cb){
var customer = {"name": "Manny Delgado", "age": 14};
var coll = db.collection("customers");
var writeConcern = {"w": "majority"};
col.insertOne( customer, writeConcern, function(err, result){
assert.equal(err, null);
assert.equal(1, result.insertedCount);
console.log("Inserted super important record");
cb(result);
});
}
http://mongodb.github.io/node-mongodb-native/2.0/api/WriteConcernError.html
Different WriteConcerns
var insertSuperImportant = function(db, cb){
var customer = {"name": "Manny Delgado", "age": 14};
var coll = db.collection("customers");
var writeConcern = {"w": "majority"};
col.insertOne( customer, writeConcern, function(err, result){
assert.equal(err, null);
assert.equal(1, result.insertedCount);
console.log("Inserted super important record");
cb(result);
});
}
http://mongodb.github.io/node-mongodb-native/2.0/api/WriteConcernError.html
Read Preference
59
Read Preference
•  Read from Primary (default)
ReadPreference.PRIMARY
•  Read from Primary Preferably
ReadPreference.PRIMARY_PREFERRED
•  Read from Secondary
ReadPreference.SECONDARY
•  Read from Secondary Preferably
ReadPreference.SECONDARY_PREFERRED
•  Read from Nearest Node
ReadPreference.NEAREST
http://mongodb.github.io/node-mongodb-native/2.0/api/ReadPreference.html
Read From Nearest
var readNearestWaterMelonColor = function(db, cb){
var rp = ReadPreference.NEAREST;
var coll = db.collection("products", {ReadPreference:rp});
var query = {"color": "water melon green"};
collection.find(query).toArray(function(err, docs){
assert.equal(err, null);
assert.equal(1, docs.length);
console.log("So many products: "+ docs.length);
console.dir(docs);
cb(docs);
});
}
http://mongodb.github.io/node-mongodb-native/2.0/api/ReadPreference.html
Read From Nearest
var readNearestWaterMelonColor = function(db, cb){
var rp = ReadPreference.NEAREST;
var coll = db.collection("products", {ReadPreference:rp});
var query = {"color": "water melon green"};
collection.find(query).toArray(function(err, docs){
assert.equal(err, null);
assert.equal(1, docs.length);
console.log("So many products: "+ docs.length);
console.dir(docs);
cb(docs);
});
}
http://mongodb.github.io/node-mongodb-native/2.0/api/ReadPreference.html
Read From Nearest
var readNearestWaterMelonColor = function(db, cb){
var rp = ReadPreference.NEAREST;
var coll = db.collection("products", {readPreference:rp});
var query = {"color": "water melon green"};
collection.find(query).toArray(function(err, docs){
assert.equal(err, null);
assert.equal(1, docs.length);
console.log("So many products: "+ docs.length);
console.dir(docs);
cb(docs);
});
}
http://mongodb.github.io/node-mongodb-native/2.0/api/ReadPreference.html
Aggregation
Aggregation
var aggregateAvgAgeGender = function( db, cb){
//{age:XX, name:"user name", gender: "M/F"}
var pipeline = [
{$group: { "_id": "$gender", avg_age: {$avg: "$age"}}},
];
var coll = db.collection("users");
var cursor = coll.aggregate(pipeline);
cursor.forEach( function(x){
console.log("Gender " + x._id + " age average " + x.avg_age)
}, function(x) {
cb(cursor);
});
}
http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#aggregate
Aggregation
var aggregateAvgAgeGender = function( db, cb){
//{age:XX, name:"user name", gender: "M/F"}
var pipeline = [
{$group: { "_id": "$gender", avg_age: {$avg: "$age"}}},
];
var coll = db.collection("users");
var cursor = coll.aggregate(pipeline);
cursor.forEach( function(x){
console.log("Gender " + x._id + " age average " + x.avg_age)
}, function(x) {
cb(cursor);
});
}
http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#aggregate
Aggregation
var aggregateAvgAgeGender = function( db, cb){
//{age:XX, name:"user name", gender: "M/F"}
var pipeline = [
{$group: { "_id": "$gender", avg_age: {$avg: "$age"}}},
];
var coll = db.collection("users");
var cursor = coll.aggregate(pipeline);
cursor.forEach( function(x){
console.log("Gender " + x._id + " age average " + x.avg_age)
}, function(x) {
cb(cursor);
});
}
http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#aggregate
Aggregation
var aggregateAvgAgeGender = function( db, cb){
//{age:XX, name:"user name", gender: "M/F"}
var pipeline = [
{$match:{"age": $gt: 18}},
{$group: { "_id": "$gender", avg_age: {$avg: "$age"}}},
{$project:{"ID": "$_id", "average": "$avg_age" }}
];
var cursor = coll.aggregate(pipeline);
var coll = db.collection("users");
cursor.forEach( function(x){
console.log("Gender " + x._id + " age average " + x.avg_age)
}, function(x) {
cb(cursor);
});}
http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#aggregate
ODM's
Mongoose
70
Mongoose
•  Schema Validation
•  Casting
•  Business Logic Wrapper
•  http://mongoosejs.com/
Simple Mongoose
var mongoose = require('mongoose'), assert =
require('assert')
var Schema = mongoose.Schema;
//define a schema
var userSchema = new Schema({ name: String, age:
Number})
//create static members
userSchema.statics.findByName = function( name, cb){
return this.find( {"name": name}, cb);
}
…
Simple Mongoose
…
//generate a model
var User = mongoose.model('User', userSchema);
//initiate the new user, validates the given arguments
var u1 = User({name:"Many Delgado", age:14});
//just save it
u1.save(function(err){
assert.equal(null, err);
});
73
Other Projects
Project Repository
MongoSkin https://github.com/kissjs/node-mongoskin
Mongolia https://github.com/masylum/mongolia
Mongojs https://github.com/mafintosh/mongojs
MongoSmash https://github.com/bengl/mongosmash
MEAN Stack
75
MEAN Stack
•  MongoDB
•  Express.js
•  Angular JS
•  Node.js
Express is a minimal and flexible Node.js web
application framework that provides a robust
set of features for web and mobile
applications.
AngularJS lets you extend HTML vocabulary
for your application. The resulting
environment is extraordinarily expressive,
readable, and quick to develop
Building your first app with MongoDB: Creating
a RESTAPI using the MEAN Stack
https://www.mongodb.com/blog/post/building-
your-first-application-mongodb-creating-rest-
api-using-mean-stack-part-1
Meteor
Meteor is a complete open source platform for
building web and mobile apps in pure
JavaScript.
81
Meteor
•  Responsiveness
•  Reactiveness
•  Multiplatform
•  Unified Package System
•  Hot Deploys
https://www.meteor.com/try
METEOR: Build IOS andAndroidApps
that are a delight to use
http://www.mongodb.com/blog/post/meteor-
build-ios-and-android-apps-are-delight-use
Recap
84
What we talked about today…
•  Node.js is a very productive language
–  Our driver is highly adopted
–  Updated
–  Fully compatible
•  CRUD Operations
–  Insert, Update, Remove, Delete
•  Write Concerns
–  Flexible to write
•  Read Preferences
–  Flexible to read
•  Aggregation Framework
–  Analytics at your fingertips
85
Large Ecosystem
•  Mongoose
•  Mean Stack
•  Meteor
•  Many other projects
86
Where to next?
•  Questions on the driver:
–  https://groups.google.com/forum/#!forum/node-mongodb-native
•  Issues:
–  https://jira.mongodb.org/browse/NODE/?
selectedTab=com.atlassian.jira.jira-projects-plugin:summary-
panel
•  Tutorial:
–  http://mongodb.github.io/node-mongodb-native/2.0/
•  Todays code:
–  https://github.com/nleite/firstappnodejs
•  Other:
–  http://www.mongodb.com/norberto
87
For More Information
Resource Location
Case Studies mongodb.com/customers
Presentations mongodb.com/presentations
Free Online Training education.mongodb.com
Webinars and Events mongodb.com/events
Documentation docs.mongodb.org
MongoDB Downloads mongodb.com/download
Additional Info info@mongodb.com
Blog blog.mongodb.com
88
Register now: mongodbworld.com!
!
Use Code NorbertoLeite for additional 25% Off!
*Come as a group of 3 or more – Save another 25%!
http://cl.jroo.me/z3/v/D/C/e/a.baa-Too-many-bicycles-on-the-van.jpg
Questions?
@nleite
norberto@mongodb.com
http://www.mongodb.com/norberto
MongoDB and Node.js

More Related Content

What's hot (20)

Understanding REST
Understanding RESTUnderstanding REST
Understanding REST
 
Android User Interface
Android User InterfaceAndroid User Interface
Android User Interface
 
Build RESTful API Using Express JS
Build RESTful API Using Express JSBuild RESTful API Using Express JS
Build RESTful API Using Express JS
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 
NodeJS for Beginner
NodeJS for BeginnerNodeJS for Beginner
NodeJS for Beginner
 
SOLID Principles and The Clean Architecture
SOLID Principles and The Clean ArchitectureSOLID Principles and The Clean Architecture
SOLID Principles and The Clean Architecture
 
Introduction to NodeJS
Introduction to NodeJSIntroduction to NodeJS
Introduction to NodeJS
 
React Native
React NativeReact Native
React Native
 
An introduction to MongoDB
An introduction to MongoDBAn introduction to MongoDB
An introduction to MongoDB
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Android chapter16-web-services
Android chapter16-web-servicesAndroid chapter16-web-services
Android chapter16-web-services
 
ASP.NET Web API
ASP.NET Web APIASP.NET Web API
ASP.NET Web API
 
Expressjs
ExpressjsExpressjs
Expressjs
 
Rest API
Rest APIRest API
Rest API
 
HTTP Request Header and HTTP Status Code
HTTP Request Header and HTTP Status CodeHTTP Request Header and HTTP Status Code
HTTP Request Header and HTTP Status Code
 
What is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | EdurekaWhat is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | Edureka
 
Express js
Express jsExpress js
Express js
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
WSDL
WSDLWSDL
WSDL
 
Node js introduction
Node js introductionNode js introduction
Node js introduction
 

Viewers also liked

How To Get Hadoop App Intelligence with Driven
How To Get Hadoop App Intelligence with DrivenHow To Get Hadoop App Intelligence with Driven
How To Get Hadoop App Intelligence with DrivenCascading
 
OPENEXPO Madrid 2015 - Advanced Applications with MongoDB
OPENEXPO Madrid 2015 - Advanced Applications with MongoDB OPENEXPO Madrid 2015 - Advanced Applications with MongoDB
OPENEXPO Madrid 2015 - Advanced Applications with MongoDB MongoDB
 
Advanced applications with MongoDB
Advanced applications with MongoDBAdvanced applications with MongoDB
Advanced applications with MongoDBNorberto Leite
 
Advanced MongoDB Aggregation Pipelines
Advanced MongoDB Aggregation PipelinesAdvanced MongoDB Aggregation Pipelines
Advanced MongoDB Aggregation PipelinesTom Schreiber
 
Data Treatment MongoDB
Data Treatment MongoDBData Treatment MongoDB
Data Treatment MongoDBNorberto Leite
 
Geospatial and MongoDB
Geospatial and MongoDBGeospatial and MongoDB
Geospatial and MongoDBNorberto Leite
 
MongoDB on Financial Services Sector
MongoDB on Financial Services SectorMongoDB on Financial Services Sector
MongoDB on Financial Services SectorNorberto Leite
 
Building Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJsBuilding Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJsSrdjan Strbanovic
 
Dcjq node.js presentation
Dcjq node.js presentationDcjq node.js presentation
Dcjq node.js presentationasync_io
 
MongoDB Certification Study Group - May 2016
MongoDB Certification Study Group - May 2016MongoDB Certification Study Group - May 2016
MongoDB Certification Study Group - May 2016Norberto Leite
 
From Monolithic to Microservices in 45 Minutes
From Monolithic to Microservices in 45 MinutesFrom Monolithic to Microservices in 45 Minutes
From Monolithic to Microservices in 45 MinutesMongoDB
 
Getting Started with MongoDB and Node.js
Getting Started with MongoDB and Node.jsGetting Started with MongoDB and Node.js
Getting Started with MongoDB and Node.jsGrant Goodale
 
How Financial Services Organizations Use MongoDB
How Financial Services Organizations Use MongoDBHow Financial Services Organizations Use MongoDB
How Financial Services Organizations Use MongoDBMongoDB
 
Introduction to Nodejs
Introduction to NodejsIntroduction to Nodejs
Introduction to NodejsGabriele Lana
 
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.jsThe MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.jsMongoDB
 

Viewers also liked (20)

harry presentation
harry presentationharry presentation
harry presentation
 
How To Get Hadoop App Intelligence with Driven
How To Get Hadoop App Intelligence with DrivenHow To Get Hadoop App Intelligence with Driven
How To Get Hadoop App Intelligence with Driven
 
OPENEXPO Madrid 2015 - Advanced Applications with MongoDB
OPENEXPO Madrid 2015 - Advanced Applications with MongoDB OPENEXPO Madrid 2015 - Advanced Applications with MongoDB
OPENEXPO Madrid 2015 - Advanced Applications with MongoDB
 
Advanced applications with MongoDB
Advanced applications with MongoDBAdvanced applications with MongoDB
Advanced applications with MongoDB
 
Data Distribution Theory
Data Distribution TheoryData Distribution Theory
Data Distribution Theory
 
Advanced MongoDB Aggregation Pipelines
Advanced MongoDB Aggregation PipelinesAdvanced MongoDB Aggregation Pipelines
Advanced MongoDB Aggregation Pipelines
 
Analyse Yourself
Analyse YourselfAnalyse Yourself
Analyse Yourself
 
Data Treatment MongoDB
Data Treatment MongoDBData Treatment MongoDB
Data Treatment MongoDB
 
MongoDB + Spring
MongoDB + SpringMongoDB + Spring
MongoDB + Spring
 
MongoDB and Python
MongoDB and PythonMongoDB and Python
MongoDB and Python
 
Geospatial and MongoDB
Geospatial and MongoDBGeospatial and MongoDB
Geospatial and MongoDB
 
MongoDB on Financial Services Sector
MongoDB on Financial Services SectorMongoDB on Financial Services Sector
MongoDB on Financial Services Sector
 
Building Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJsBuilding Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJs
 
Dcjq node.js presentation
Dcjq node.js presentationDcjq node.js presentation
Dcjq node.js presentation
 
MongoDB Certification Study Group - May 2016
MongoDB Certification Study Group - May 2016MongoDB Certification Study Group - May 2016
MongoDB Certification Study Group - May 2016
 
From Monolithic to Microservices in 45 Minutes
From Monolithic to Microservices in 45 MinutesFrom Monolithic to Microservices in 45 Minutes
From Monolithic to Microservices in 45 Minutes
 
Getting Started with MongoDB and Node.js
Getting Started with MongoDB and Node.jsGetting Started with MongoDB and Node.js
Getting Started with MongoDB and Node.js
 
How Financial Services Organizations Use MongoDB
How Financial Services Organizations Use MongoDBHow Financial Services Organizations Use MongoDB
How Financial Services Organizations Use MongoDB
 
Introduction to Nodejs
Introduction to NodejsIntroduction to Nodejs
Introduction to Nodejs
 
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.jsThe MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
 

Similar to MongoDB and Node.js

Webinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.jsWebinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.jsMongoDB
 
Webinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.jsWebinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.jsMongoDB
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBMongoDB
 
Parse cloud code
Parse cloud codeParse cloud code
Parse cloud code維佋 唐
 
MeaNstack on Docker
MeaNstack on DockerMeaNstack on Docker
MeaNstack on DockerDaniel Ku
 
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...MongoDB
 
Practical Chef and Capistrano for Your Rails App
Practical Chef and Capistrano for Your Rails AppPractical Chef and Capistrano for Your Rails App
Practical Chef and Capistrano for Your Rails AppSmartLogic
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBChun-Kai Wang
 
How To Build and Run Node Apps with Docker and Compose
How To Build and Run Node Apps with Docker and ComposeHow To Build and Run Node Apps with Docker and Compose
How To Build and Run Node Apps with Docker and ComposeDocker, Inc.
 
Get expertise with mongo db
Get expertise with mongo dbGet expertise with mongo db
Get expertise with mongo dbAmit Thakkar
 
From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...Jérôme Petazzoni
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBTobias Trelle
 
오픈 소스 프로그래밍 - NoSQL with Python
오픈 소스 프로그래밍 - NoSQL with Python오픈 소스 프로그래밍 - NoSQL with Python
오픈 소스 프로그래밍 - NoSQL with PythonIan Choi
 
Introduction to MongoDB with PHP
Introduction to MongoDB with PHPIntroduction to MongoDB with PHP
Introduction to MongoDB with PHPfwso
 
Rails Engine | Modular application
Rails Engine | Modular applicationRails Engine | Modular application
Rails Engine | Modular applicationmirrec
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Cosimo Streppone
 
BedCon 2013 - Java Persistenz-Frameworks für MongoDB
BedCon 2013 - Java Persistenz-Frameworks für MongoDBBedCon 2013 - Java Persistenz-Frameworks für MongoDB
BedCon 2013 - Java Persistenz-Frameworks für MongoDBTobias Trelle
 

Similar to MongoDB and Node.js (20)

Webinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.jsWebinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.js
 
Webinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.jsWebinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.js
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDB
 
Parse cloud code
Parse cloud codeParse cloud code
Parse cloud code
 
Rails with mongodb
Rails with mongodbRails with mongodb
Rails with mongodb
 
MeaNstack on Docker
MeaNstack on DockerMeaNstack on Docker
MeaNstack on Docker
 
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...
 
Practical Chef and Capistrano for Your Rails App
Practical Chef and Capistrano for Your Rails AppPractical Chef and Capistrano for Your Rails App
Practical Chef and Capistrano for Your Rails App
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
How To Build and Run Node Apps with Docker and Compose
How To Build and Run Node Apps with Docker and ComposeHow To Build and Run Node Apps with Docker and Compose
How To Build and Run Node Apps with Docker and Compose
 
Mongodb
MongodbMongodb
Mongodb
 
Get expertise with mongo db
Get expertise with mongo dbGet expertise with mongo db
Get expertise with mongo db
 
From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDB
 
오픈 소스 프로그래밍 - NoSQL with Python
오픈 소스 프로그래밍 - NoSQL with Python오픈 소스 프로그래밍 - NoSQL with Python
오픈 소스 프로그래밍 - NoSQL with Python
 
Introduction to MongoDB with PHP
Introduction to MongoDB with PHPIntroduction to MongoDB with PHP
Introduction to MongoDB with PHP
 
Rails Engine | Modular application
Rails Engine | Modular applicationRails Engine | Modular application
Rails Engine | Modular application
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013
 
BedCon 2013 - Java Persistenz-Frameworks für MongoDB
BedCon 2013 - Java Persistenz-Frameworks für MongoDBBedCon 2013 - Java Persistenz-Frameworks für MongoDB
BedCon 2013 - Java Persistenz-Frameworks für MongoDB
 
MongoDB and DynamoDB
MongoDB and DynamoDBMongoDB and DynamoDB
MongoDB and DynamoDB
 

More from Norberto Leite

Data Modelling for MongoDB - MongoDB.local Tel Aviv
Data Modelling for MongoDB - MongoDB.local Tel AvivData Modelling for MongoDB - MongoDB.local Tel Aviv
Data Modelling for MongoDB - MongoDB.local Tel AvivNorberto Leite
 
MongoDB WiredTiger Internals
MongoDB WiredTiger InternalsMongoDB WiredTiger Internals
MongoDB WiredTiger InternalsNorberto Leite
 
MongoDB 3.2 Feature Preview
MongoDB 3.2 Feature PreviewMongoDB 3.2 Feature Preview
MongoDB 3.2 Feature PreviewNorberto Leite
 
MongoDB: Agile Combustion Engine
MongoDB: Agile Combustion EngineMongoDB: Agile Combustion Engine
MongoDB: Agile Combustion EngineNorberto Leite
 
MongoDB Capacity Planning
MongoDB Capacity PlanningMongoDB Capacity Planning
MongoDB Capacity PlanningNorberto Leite
 
Strongly Typed Languages and Flexible Schemas
Strongly Typed Languages and Flexible SchemasStrongly Typed Languages and Flexible Schemas
Strongly Typed Languages and Flexible SchemasNorberto Leite
 
Effectively Deploying MongoDB on AEM
Effectively Deploying MongoDB on AEMEffectively Deploying MongoDB on AEM
Effectively Deploying MongoDB on AEMNorberto Leite
 
Let the Tiger Roar - MongoDB 3.0
Let the Tiger Roar - MongoDB 3.0Let the Tiger Roar - MongoDB 3.0
Let the Tiger Roar - MongoDB 3.0Norberto Leite
 
MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know Norberto Leite
 
MongoDB Capacity Planning
MongoDB Capacity PlanningMongoDB Capacity Planning
MongoDB Capacity PlanningNorberto Leite
 
Building your first app with MongoDB
Building your first app with MongoDBBuilding your first app with MongoDB
Building your first app with MongoDBNorberto Leite
 

More from Norberto Leite (20)

Data Modelling for MongoDB - MongoDB.local Tel Aviv
Data Modelling for MongoDB - MongoDB.local Tel AvivData Modelling for MongoDB - MongoDB.local Tel Aviv
Data Modelling for MongoDB - MongoDB.local Tel Aviv
 
Avoid Query Pitfalls
Avoid Query PitfallsAvoid Query Pitfalls
Avoid Query Pitfalls
 
MongoDB and Spark
MongoDB and SparkMongoDB and Spark
MongoDB and Spark
 
Mongo db 3.4 Overview
Mongo db 3.4 OverviewMongo db 3.4 Overview
Mongo db 3.4 Overview
 
MongodB Internals
MongodB InternalsMongodB Internals
MongodB Internals
 
MongoDB WiredTiger Internals
MongoDB WiredTiger InternalsMongoDB WiredTiger Internals
MongoDB WiredTiger Internals
 
MongoDB 3.2 Feature Preview
MongoDB 3.2 Feature PreviewMongoDB 3.2 Feature Preview
MongoDB 3.2 Feature Preview
 
Mongodb Spring
Mongodb SpringMongodb Spring
Mongodb Spring
 
MongoDB on Azure
MongoDB on AzureMongoDB on Azure
MongoDB on Azure
 
MongoDB: Agile Combustion Engine
MongoDB: Agile Combustion EngineMongoDB: Agile Combustion Engine
MongoDB: Agile Combustion Engine
 
MongoDB Capacity Planning
MongoDB Capacity PlanningMongoDB Capacity Planning
MongoDB Capacity Planning
 
Spark and MongoDB
Spark and MongoDBSpark and MongoDB
Spark and MongoDB
 
Python and MongoDB
Python and MongoDB Python and MongoDB
Python and MongoDB
 
Strongly Typed Languages and Flexible Schemas
Strongly Typed Languages and Flexible SchemasStrongly Typed Languages and Flexible Schemas
Strongly Typed Languages and Flexible Schemas
 
Effectively Deploying MongoDB on AEM
Effectively Deploying MongoDB on AEMEffectively Deploying MongoDB on AEM
Effectively Deploying MongoDB on AEM
 
MongoDB Ops Manager
MongoDB Ops ManagerMongoDB Ops Manager
MongoDB Ops Manager
 
Let the Tiger Roar - MongoDB 3.0
Let the Tiger Roar - MongoDB 3.0Let the Tiger Roar - MongoDB 3.0
Let the Tiger Roar - MongoDB 3.0
 
MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know
 
MongoDB Capacity Planning
MongoDB Capacity PlanningMongoDB Capacity Planning
MongoDB Capacity Planning
 
Building your first app with MongoDB
Building your first app with MongoDBBuilding your first app with MongoDB
Building your first app with MongoDB
 

Recently uploaded

What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2
 

Recently uploaded (20)

What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 

MongoDB and Node.js

  • 1. MongoDB + Node.js Building first app with MongoDB and Node.js
  • 3. 3 Ola, I'm Norberto! Norberto Leite Technical Evangelist Madrid, Spain @nleite norberto@mongodb.com http://www.mongodb.com/norberto
  • 7. 7 Few reasons why Flexible Agile Web Language
  • 8. 8 MongoDB + Javascript •  MongoDB Shell –  JS interperter •  MongoDB MapReduce –  Runs on top of V8 –  Map and Reduce functions are JS functions •  Native support for Node.js –  One of the most used Drivers out there! –  https://www.npmjs.com/package/mongodb
  • 11. 11 2 Foundations •  Events / Event Loop –  Single Thread Applications –  No threads –  Events Emitter –  Event Queue –  Known Events •  Streams –  Read, Write, Both –  Unix Pipes –  We use it extensively!
  • 13. npm package $ npm install mongodb
  • 17. package.json file $ mkdir firstappnodejs $ cd firstappnodejs $ npm init
  • 18. package.json file $ mkdir firstappnodejs $ cd firstappnodejs $ npm init ... { "name": "firstappnodejs", "version": "0.0.1", "description": "Small demo webinar application", "main": "index.js", "scripts": { "test": "workitout" }, "repository": { "type": "git", "url": "git://github.com/nleite/firstappnodejs" }, "dependencies": { "mongodb": "~2.0" }, "keywords": [http://docs.mongodb.org/ecosystem/drivers/node-js/#compatibility "demo", "nodejs", "mongodb" ], "author": "Norberto Leite", "license": "Apache 2.0", "bugs": { "url": "https://github.com/nleite/firstappnodejs/issues" }, "homepage": "https://github.com/nleite/firstappnodejs"
  • 19. package.json file $ mkdir firstappnodejs $ cd firstappnodejs $ npm init ... { "name": "firstappnodejs", "version": "0.0.1", "description": "Small demo webinar application", "main": "index.js", "scripts": { "test": "workitout" }, "repository": { "type": "git", "url": "git://github.com/nleite/firstappnodejs" }, "dependencies": { "mongodb": "~2.0" }, "keywords": [ "demo", "nodejs", "mongodb" ], "author": "Norberto Leite", "license": "Apache 2.0", "bugs": { "url": "https://github.com/nleite/firstappnodejs/issues" }, "homepage": "https://github.com/nleite/firstappnodejs"
  • 20. Install our new firstappnodejs app! $ npm install > kerberos@0.0.10 install … … > bson@0.3.1 install > mongodb@2.0.28 node_modules/mongodb ├── readable-stream@1.0.31 (isarray@0.0.1, inherits@2.0.1, string_decoder@0.10.31, core-util-is@1.0.1) └── mongodb-core@1.1.25 (kerberos@0.0.10, bson@0.3.1) firstappnodejs/ $ ls node_modules package.json
  • 22. boot up MongoDB Server $ mkdir ~/firstappdb $ mongod --dbpath ~/firstappdb
  • 23. boot up MongoDB Server $ mkdir ~/firstappdb $ mongod --dbpath ~/firstappdb --auth --keyfile ~/n.pem https://www.mongodb.com/products/mongodb-enterprise-advanced
  • 24. boot up MongoDB Server $ mkdir ~/firstappdb $ mongod --dbpath ~/firstappdb --auth --keyfile ~/n.pem https://www.mongodb.com/products/mongodb-enterprise-advanced
  • 25. var MongoClient = require('mongodb').MongoClient, assert = require('assert'); Connect
  • 26. var MongoClient = require('mongodb').MongoClient, assert = require('assert'); //connection uri var uri = "mongodb://localhost:27017/firstapp" Connect
  • 27. var MongoClient = require('mongodb').MongoClient, assert = require('assert'); //connection uri var uri = "mongodb://localhost:27017/firstapp" //connect to MongoDB MongoClient.connect(uri, function(err, db){ assert.equal(null, err); console.log("Connected correctly to server"); db.close(); }); Connect
  • 28. 28 Connection Pooling •  No traditional Pooling mechanism –  Single thread process •  Sockets to pipeline operations •  Failover –  Buffering up operations –  bufferMaxEntries –  numberOfRetries –  retryMiliSeconds http://mongodb.github.io/node-mongodb-native/2.0/api/Db.html
  • 29. CRUD
  • 30. var insertDocuments = function(db, cb){ //we don't need to explicitly create a collection var collection = db.collection('myCollection'); collection.insertMany([ {"mongodb": "is just awesome"}, {"nodejs": "so awesome"} ], function(err, result){ assert.equal(null, err); //inserted 2 documents assert.equal(2, result.insertedCount); //invoke callback cb(result); }); } Insert http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#insert
  • 31. var insertDocuments = function(db, cb){ //we don't need to explicitly create a collection var collection = db.collection('myCollection'); collection.insertMany([ {"mongodb": "is just awesome"}, {"nodejs": "so awesome"} ], function(err, result){ assert.equal(null, err); //inserted 2 documents assert.equal(2, result.insertedCount); //invoke callback cb(result); }); } Insert http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#insert
  • 32. var insertDocuments = function(db, cb){ //we don't need to explicitly create a collection var collection = db.collection('myCollection'); collection.insertMany([ {"mongodb": "is just awesome"}, {"nodejs": "so awesome"} ], function(err, result){ assert.equal(null, err); //inserted 2 documents assert.equal(2, result.insertedCount); //invoke callback cb(result); }); } Insert http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#insert
  • 33. var insertDocuments = function(db, cb){ //we don't need to explicitly create a collection var collection = db.collection('myCollection'); collection.insertMany([ {"mongodb": "is just awesome"}, {"nodejs": "so awesome"} ], function(err, result){ assert.equal(null, err); //inserted 2 documents assert.equal(2, result.insertedCount); //invoke callback cb(result); }); } Insert http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#insert
  • 34. MongoClient.connect(uri, function(err, db) { assert.equal(null, err); console.log("Sweet! Talking to Server"); insertDocuments(db, function() { db.close(); }); }); Insert http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#insert
  • 35. MongoClient.connect(uri, function(err, db) { assert.equal(null, err); console.log("Sweet! Talking to Server"); insertDocuments(db, function() { db.close(); }); }); Insert http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#insert
  • 36. var updateDocument = function(db, cb){ var collection = db.collection("myCollection"); collection.updateOne( {"mongodb": "is just awesome"}, {$set: {"users": ["nleite"]}}, function( err, result){ assert.equal(null, err); assert.equal(1, result.modifiedCount); console.log("Cool, just updated"); cb(result); }); } Update http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#update
  • 37. var updateDocument = function(db, cb){ var collection = db.collection("myCollection"); collection.updateOne( {"mongodb": "is just awesome"}, {$set: {"users": ["nleite"]}}, function( err, result){ assert.equal(null, err); assert.equal(1, result.modifiedCount); console.log("Cool, just updated"); cb(result); }); } Update http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#update
  • 38. var updateDocument = function(db, cb){ var collection = db.collection("myCollection"); collection.updateOne( {"mongodb": "is just awesome"}, {$set: {"users": ["nleite"]}}, function( err, result){ assert.equal(null, err); assert.equal(1, result.modifiedCount); console.log("Cool, just updated"); cb(result); }); } Update http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#update
  • 39. var updateDocument = function(db, cb){ var collection = db.collection("myCollection"); collection.updateOne( {"mongodb": "is just awesome"}, {$set: {"users": ["nleite"]}}, function( err, result){ assert.equal(null, err); assert.equal(1, result.modifiedCount); console.log("Cool, just updated"); cb(result); }); } Update http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#update
  • 40. MongoClient.connect(uri, function(err, db) { assert.equal(null, err); console.log("Ok, I can now update!"); updateDocuments(db, function() { db.close(); }); }); Update http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#update
  • 41. Remove var removeDocument = function(db, cb){ var collection = db.collection("myCollection"); collection.deleteOne( {"users": "nleite"}, function( err, result){ assert.equal(null, err); assert.equal(1, result.deletedCount); console.log("purged the @nleite contaminated data!"); cb(result); }); } http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#remove
  • 42. Remove var removeDocument = function(db, cb){ var collection = db.collection("myCollection"); collection.deleteOne( {"users": "nleite"}, function( err, result){ assert.equal(null, err); assert.equal(1, result.deletedCount); console.log("purged the @nleite contaminated data!"); cb(result); }); } http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#remove
  • 43. Remove var removeDocument = function(db, cb){ var collection = db.collection("myCollection"); collection.deleteOne( {"users": "nleite"}, function( err, result){ assert.equal(null, err); assert.equal(1, result.deletedCount); console.log("purged the @nleite contaminated data!"); cb(result); }); } http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#remove
  • 44. Remove MongoClient.connect(uri, function(err, db) { assert.equal(null, err); console.log("Ok, I can now delete!"); removeDocuments(db, function() { db.close(); }); }); http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#remove
  • 45. Find var findAllDocuments = function(db, cb){ var collection = db.collection('myDocuments'); //or collection.find() collection.find({}).toArray(function(err, docs){ assert.equal(err, null); assert.equal(1, docs.length); console.log("Gotcha! found "+ docs.length); console.dir(docs); cb(docs); }); } http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#find
  • 46. Find var findAllDocuments = function(db, cb){ var collection = db.collection('myDocuments'); //or collection.find() collection.find({}).toArray(function(err, docs){ assert.equal(err, null); assert.equal(1, docs.length); console.log("Gotcha! found "+ docs.length); console.dir(docs); cb(docs); }); } http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#find
  • 47. Find var findAllDocuments = function(db, cb){ var collection = db.collection('myDocuments'); //or collection.find() collection.find({}).toArray(function(err, docs){ assert.equal(err, null); assert.equal(1, docs.length); console.log("Gotcha! found "+ docs.length); console.dir(docs); cb(docs); }); } http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#find
  • 50. Different Schemas var insertDifferentShapes = function(db, cb){ var doc1 = {"name": "Norberto", "talks": [ {"nodejs":10}, {"java":15}, "python":11]}; var doc2 = {"name": "Bryan", "webinars": 30}; var coll = db.collection("content") coll.insertMany( [doc1, doc2], function(err, result){ assert.equal(err, null); assert.equal(2, result.insertedCount); console.log("Sweet, inserted "+ result.insertedCount); cb(result); }); } http://docs.mongodb.org/manual/data-modeling/
  • 51. Different Schemas var insertDifferentShapes = function(db, cb){ var doc1 = {"name": "Norberto", "talks": [ {"nodejs":10}, {"java":15}, "python":11]}; var doc2 = {"name": "Bryan", "webinars": 30}; var coll = db.collection("content") coll.insertMany( [doc1, doc2], function(err, result){ assert.equal(err, null); assert.equal(2, result.insertedCount); console.log("Sweet, inserted "+ result.insertedCount); cb(result); }); } http://docs.mongodb.org/manual/data-modeling/
  • 56. Different WriteConcerns var insertSuperImportant = function(db, cb){ var customer = {"name": "Manny Delgado", "age": 14}; var coll = db.collection("customers"); var writeConcern = {"w": "majority"}; col.insertOne( customer, writeConcern, function(err, result){ assert.equal(err, null); assert.equal(1, result.insertedCount); console.log("Inserted super important record"); cb(result); }); } http://mongodb.github.io/node-mongodb-native/2.0/api/WriteConcernError.html
  • 57. Different WriteConcerns var insertSuperImportant = function(db, cb){ var customer = {"name": "Manny Delgado", "age": 14}; var coll = db.collection("customers"); var writeConcern = {"w": "majority"}; col.insertOne( customer, writeConcern, function(err, result){ assert.equal(err, null); assert.equal(1, result.insertedCount); console.log("Inserted super important record"); cb(result); }); } http://mongodb.github.io/node-mongodb-native/2.0/api/WriteConcernError.html
  • 59. 59 Read Preference •  Read from Primary (default) ReadPreference.PRIMARY •  Read from Primary Preferably ReadPreference.PRIMARY_PREFERRED •  Read from Secondary ReadPreference.SECONDARY •  Read from Secondary Preferably ReadPreference.SECONDARY_PREFERRED •  Read from Nearest Node ReadPreference.NEAREST http://mongodb.github.io/node-mongodb-native/2.0/api/ReadPreference.html
  • 60. Read From Nearest var readNearestWaterMelonColor = function(db, cb){ var rp = ReadPreference.NEAREST; var coll = db.collection("products", {ReadPreference:rp}); var query = {"color": "water melon green"}; collection.find(query).toArray(function(err, docs){ assert.equal(err, null); assert.equal(1, docs.length); console.log("So many products: "+ docs.length); console.dir(docs); cb(docs); }); } http://mongodb.github.io/node-mongodb-native/2.0/api/ReadPreference.html
  • 61. Read From Nearest var readNearestWaterMelonColor = function(db, cb){ var rp = ReadPreference.NEAREST; var coll = db.collection("products", {ReadPreference:rp}); var query = {"color": "water melon green"}; collection.find(query).toArray(function(err, docs){ assert.equal(err, null); assert.equal(1, docs.length); console.log("So many products: "+ docs.length); console.dir(docs); cb(docs); }); } http://mongodb.github.io/node-mongodb-native/2.0/api/ReadPreference.html
  • 62. Read From Nearest var readNearestWaterMelonColor = function(db, cb){ var rp = ReadPreference.NEAREST; var coll = db.collection("products", {readPreference:rp}); var query = {"color": "water melon green"}; collection.find(query).toArray(function(err, docs){ assert.equal(err, null); assert.equal(1, docs.length); console.log("So many products: "+ docs.length); console.dir(docs); cb(docs); }); } http://mongodb.github.io/node-mongodb-native/2.0/api/ReadPreference.html
  • 64. Aggregation var aggregateAvgAgeGender = function( db, cb){ //{age:XX, name:"user name", gender: "M/F"} var pipeline = [ {$group: { "_id": "$gender", avg_age: {$avg: "$age"}}}, ]; var coll = db.collection("users"); var cursor = coll.aggregate(pipeline); cursor.forEach( function(x){ console.log("Gender " + x._id + " age average " + x.avg_age) }, function(x) { cb(cursor); }); } http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#aggregate
  • 65. Aggregation var aggregateAvgAgeGender = function( db, cb){ //{age:XX, name:"user name", gender: "M/F"} var pipeline = [ {$group: { "_id": "$gender", avg_age: {$avg: "$age"}}}, ]; var coll = db.collection("users"); var cursor = coll.aggregate(pipeline); cursor.forEach( function(x){ console.log("Gender " + x._id + " age average " + x.avg_age) }, function(x) { cb(cursor); }); } http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#aggregate
  • 66. Aggregation var aggregateAvgAgeGender = function( db, cb){ //{age:XX, name:"user name", gender: "M/F"} var pipeline = [ {$group: { "_id": "$gender", avg_age: {$avg: "$age"}}}, ]; var coll = db.collection("users"); var cursor = coll.aggregate(pipeline); cursor.forEach( function(x){ console.log("Gender " + x._id + " age average " + x.avg_age) }, function(x) { cb(cursor); }); } http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#aggregate
  • 67. Aggregation var aggregateAvgAgeGender = function( db, cb){ //{age:XX, name:"user name", gender: "M/F"} var pipeline = [ {$match:{"age": $gt: 18}}, {$group: { "_id": "$gender", avg_age: {$avg: "$age"}}}, {$project:{"ID": "$_id", "average": "$avg_age" }} ]; var cursor = coll.aggregate(pipeline); var coll = db.collection("users"); cursor.forEach( function(x){ console.log("Gender " + x._id + " age average " + x.avg_age) }, function(x) { cb(cursor); });} http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#aggregate
  • 68. ODM's
  • 70. 70 Mongoose •  Schema Validation •  Casting •  Business Logic Wrapper •  http://mongoosejs.com/
  • 71. Simple Mongoose var mongoose = require('mongoose'), assert = require('assert') var Schema = mongoose.Schema; //define a schema var userSchema = new Schema({ name: String, age: Number}) //create static members userSchema.statics.findByName = function( name, cb){ return this.find( {"name": name}, cb); } …
  • 72. Simple Mongoose … //generate a model var User = mongoose.model('User', userSchema); //initiate the new user, validates the given arguments var u1 = User({name:"Many Delgado", age:14}); //just save it u1.save(function(err){ assert.equal(null, err); });
  • 73. 73 Other Projects Project Repository MongoSkin https://github.com/kissjs/node-mongoskin Mongolia https://github.com/masylum/mongolia Mongojs https://github.com/mafintosh/mongojs MongoSmash https://github.com/bengl/mongosmash
  • 75. 75 MEAN Stack •  MongoDB •  Express.js •  Angular JS •  Node.js
  • 76. Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.
  • 77. AngularJS lets you extend HTML vocabulary for your application. The resulting environment is extraordinarily expressive, readable, and quick to develop
  • 78. Building your first app with MongoDB: Creating a RESTAPI using the MEAN Stack https://www.mongodb.com/blog/post/building- your-first-application-mongodb-creating-rest- api-using-mean-stack-part-1
  • 80. Meteor is a complete open source platform for building web and mobile apps in pure JavaScript.
  • 81. 81 Meteor •  Responsiveness •  Reactiveness •  Multiplatform •  Unified Package System •  Hot Deploys https://www.meteor.com/try
  • 82. METEOR: Build IOS andAndroidApps that are a delight to use http://www.mongodb.com/blog/post/meteor- build-ios-and-android-apps-are-delight-use
  • 83. Recap
  • 84. 84 What we talked about today… •  Node.js is a very productive language –  Our driver is highly adopted –  Updated –  Fully compatible •  CRUD Operations –  Insert, Update, Remove, Delete •  Write Concerns –  Flexible to write •  Read Preferences –  Flexible to read •  Aggregation Framework –  Analytics at your fingertips
  • 85. 85 Large Ecosystem •  Mongoose •  Mean Stack •  Meteor •  Many other projects
  • 86. 86 Where to next? •  Questions on the driver: –  https://groups.google.com/forum/#!forum/node-mongodb-native •  Issues: –  https://jira.mongodb.org/browse/NODE/? selectedTab=com.atlassian.jira.jira-projects-plugin:summary- panel •  Tutorial: –  http://mongodb.github.io/node-mongodb-native/2.0/ •  Todays code: –  https://github.com/nleite/firstappnodejs •  Other: –  http://www.mongodb.com/norberto
  • 87. 87 For More Information Resource Location Case Studies mongodb.com/customers Presentations mongodb.com/presentations Free Online Training education.mongodb.com Webinars and Events mongodb.com/events Documentation docs.mongodb.org MongoDB Downloads mongodb.com/download Additional Info info@mongodb.com Blog blog.mongodb.com
  • 88. 88 Register now: mongodbworld.com! ! Use Code NorbertoLeite for additional 25% Off! *Come as a group of 3 or more – Save another 25%!