SlideShare a Scribd company logo
MEHN STACK
By Narendranath Reddy
Day 1
Theory…
Name: Narendranath Reddy Thota
 d3 Whitepaper Core Team
 Trainer from Gama
 Blockchain Full Stack Developer
 Technology Analyst
 Software Developer
 Technology Speaker
MAERSK
Email: narendranath.thota@ust-global.com
P: +917288838869
AGENDA
Day 1: Full theory(MEHN) and mongodb practical
Day 2: Full practical developing code from scratch MEHN
Day3:
Brief explanation on How complex code is, if we doesn't use
handlebars JS in our app
some theory on popular java scripts and demo on vanilla
script.
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
NOSQL
• Key-value
• Graph database
• Document-oriented
• Column family
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
IN PRODUCTION
20
http://www.mongodb.org/about/production-deployments/
RDBMS MongoDB
Database Database
Table,
View
Collection
Row Document (JSON,
BSON)
Column Field
Index Index
Join Embedded
Document
Foreign
Key
Reference
Partition Shard
> db.user.findOne({age:39})
{
"_id" :
ObjectId("5114e0bd42…"),
"first" : "John",
"last" : "Doe",
"age" : 39,
"interests" : [
"Reading",
"Mountain Biking ]
"favorites": {
"color": "Blue",
"sport": "Soccer"}
}
CRUD
• Create
• db.collection.insert( <document> )
• db.collection.save( <document> )
• db.collection.update( <query>, <update>, { upsert: true } )
• Read
• db.collection.find( <query>, <projection> )
• db.collection.findOne( <query>, <projection> )
• Update
• db.collection.update( <query>, <update>, <options> )
• Delete
• db.collection.remove( <query>, <justOne> )
22
Projection?
INSERT VS
INSERTONE
• Insert
(deprecated)
• insertOne
• insertMany
MongoDB's update() and save() methods
are used to update document into a collection.
Update vs save
Update: changes an existing document found by
your find-parameters and does nothing when no
such document exist (unless you use the upsert =
true option).
Save: doesn't allow any find-parameters. It checks if
there is a document with the same _id as the one
you save exists. When it exists, it replaces it. When
no such document exists, it inserts the document as
a new one.
CRUD EXAMPLE
24
> db.user.insert({
first: "John",
last : "Doe",
age: 39
})
> db.user.find ()
{
"_id" : ObjectId("51…"),
"first" : "John",
"last" : "Doe",
"age" : 39
}
> db.user.update(
{"_id" : ObjectId("51…")},
{
$set: {
age: 40,
salary: 7000}
}
)
> db.user.remove({
"first": /^J/
})
FEATURES
• Document-Oriented storege
• Full Index Support
• Replication & High
Availability
• Auto-Sharding
• Querying
• Fast In-Place Updates
• Map/Reduce
25
Agile
Scalable
Auto-Sharding ?
INSTALLATION• https://www.mongodb.com/download-center#enterprise
• Two ways to start
• 1: Normal way
• mongodb –dbpath D:mongodatadb
• mongo
• 2: Background as a service
Command1: Mongod --directoryperdb –dbpath D:mongodatadb
--logpath D:mongologmongo.log –logappend –rest --install
Command 2: Net start MongoDB
LIVE DEMO IN MONGO CLIENT
•Mongodb major developer Operations
Better will do this in practical session slot
CONNECT MONGODB TO OUR APPvar url = "mongodb://localhost:27017/database-name";
var MongoClient =require('mongodb').MongoClient;
List All:
MongoClient.connect(url, function(err, db) {
var result = [];
if (err) throw err;
var cursor =db.collection('mehn').find({});
cursor.forEach(function(doc, err) {
result.push(doc);
}, function() {
db.close();
});
});
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
OTHER WAYS…
var express = require('express');
var app = express();
var server = app.listen(8085, function () {
var host = server.address().address
var port = server.address().port
console.log("Example app listening at http://%s:%s", host, port)
})
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
"plugins" known as middleware.
https://stephensugden.com/middleware_guide/
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
Mongodb ExpressJS HandlebarsJS NodeJS FullStack
EXPRESS-HANDLEBARS
var express = require('express');
var path = require('path');
var app = express();
// View Engine
var exphbs = require('express-handlebars');
app.set('views', path.join(__dirname, 'views'));
app.engine('handlebars',exphbs({defaultLayout:'layout'}));
app.set('view engine', 'handlebars');
//end view Engine for handlebars
STEPS:
• 1) make new newfolder – npm init
• 2) mention all required packages in package.json
• 3) npm install
• 4) structure
• – views folder
• layouts folder
• layout(default)file
Home.handlebars-file
Login.handlebars-file
.
├── app.js
└── views
├── home.handlebars
└── layouts
└── main.handlebars
2 directories, 3 files
PACKAGE NAMES:
• "dependencies": {
• "body-parser": "*",
• "express": "*",
• "express-handlebars": "*",
• "file-system": "^2.2.2",
• "express-validator": "^4.2.1",
• "mongodb": "*",
• "node-dev": "^3.1.3" // Auto restart - server
• }
JAVASCRIPT
FRAMEWORKS
THANK YOU.
Day2 Practical Demo
From the scratch in front of you
CRUD Operation
Pre – requisites:
Nodejs v8
Mongo dB
Frameworks:
Express
HandlebarsJS

More Related Content

What's hot (20)

PPTX
gRPC on .NET Core - NDC Oslo 2020
James Newton-King
 
PPTX
MongoDB Schema Design: Practical Applications and Implications
MongoDB
 
PDF
Social Data and Log Analysis Using MongoDB
Takahiro Inoue
 
PDF
Webinar: Building Your First App with MongoDB and Java
MongoDB
 
PPTX
MongoDB and Spark
Norberto Leite
 
PPTX
Getting Started with MongoDB Using the Microsoft Stack
MongoDB
 
PPTX
Back to Basics, webinar 2: La tua prima applicazione MongoDB
MongoDB
 
PPTX
MongoDB Best Practices for Developers
Moshe Kaplan
 
PPT
MongoDB Roadmap
MongoDB
 
PPTX
Back to Basics 2017: Introduction to Sharding
MongoDB
 
PDF
MongoDB .local Toronto 2019: MongoDB Atlas Search Deep Dive
MongoDB
 
PPTX
Beyond the Basics 2: Aggregation Framework
MongoDB
 
PPT
Real World Application Performance with MongoDB
MongoDB
 
PPTX
Back to Basics Webinar 5: Introduction to the Aggregation Framework
MongoDB
 
PPTX
How to leverage MongoDB for Big Data Analysis and Operations with MongoDB's A...
Gianfranco Palumbo
 
PDF
Webinar: Developing with the modern App Stack: MEAN and MERN (with Angular2 a...
MongoDB
 
PDF
MongoDB for Analytics
MongoDB
 
PDF
MongoDB Launchpad 2016: MongoDB 3.4: Your Database Evolved
MongoDB
 
PPTX
Agility and Scalability with MongoDB
MongoDB
 
PDF
MongoDB Atlas Workshop - Singapore
Ashnikbiz
 
gRPC on .NET Core - NDC Oslo 2020
James Newton-King
 
MongoDB Schema Design: Practical Applications and Implications
MongoDB
 
Social Data and Log Analysis Using MongoDB
Takahiro Inoue
 
Webinar: Building Your First App with MongoDB and Java
MongoDB
 
MongoDB and Spark
Norberto Leite
 
Getting Started with MongoDB Using the Microsoft Stack
MongoDB
 
Back to Basics, webinar 2: La tua prima applicazione MongoDB
MongoDB
 
MongoDB Best Practices for Developers
Moshe Kaplan
 
MongoDB Roadmap
MongoDB
 
Back to Basics 2017: Introduction to Sharding
MongoDB
 
MongoDB .local Toronto 2019: MongoDB Atlas Search Deep Dive
MongoDB
 
Beyond the Basics 2: Aggregation Framework
MongoDB
 
Real World Application Performance with MongoDB
MongoDB
 
Back to Basics Webinar 5: Introduction to the Aggregation Framework
MongoDB
 
How to leverage MongoDB for Big Data Analysis and Operations with MongoDB's A...
Gianfranco Palumbo
 
Webinar: Developing with the modern App Stack: MEAN and MERN (with Angular2 a...
MongoDB
 
MongoDB for Analytics
MongoDB
 
MongoDB Launchpad 2016: MongoDB 3.4: Your Database Evolved
MongoDB
 
Agility and Scalability with MongoDB
MongoDB
 
MongoDB Atlas Workshop - Singapore
Ashnikbiz
 

Similar to Mongodb ExpressJS HandlebarsJS NodeJS FullStack (20)

PDF
MongoDB for Coder Training (Coding Serbia 2013)
Uwe Printz
 
KEY
London MongoDB User Group April 2011
Rainforest QA
 
PPTX
Introduction to MongoDB – A NoSQL Database
manikgupta2k04
 
KEY
Seedhack MongoDB 2011
Rainforest QA
 
PPTX
Mongo db
Ramakrishna kapa
 
PPT
Mongo db basics
Dhaval Mistry
 
PPTX
No SQL DB lecture showing structure and syntax
Georges Abboudeh
 
PPTX
Mongo Nosql CRUD Operations
anujaggarwal49
 
PPT
9. Document Oriented Databases
Fabio Fumarola
 
PDF
MongoDB
techwhizbang
 
PPTX
MongoDB - An Introduction
dinkar thakur
 
PDF
Mongo db basics
Harischandra M K
 
PPTX
Mongo db
Girish Talekar
 
PPT
MongoDB
kesavan N B
 
PPTX
Webinar: Building Your First App in Node.js
MongoDB
 
PPTX
Webinar: Building Your First App in Node.js
MongoDB
 
PPTX
MongoDB_ppt.pptx
1AP18CS037ShirishKul
 
PDF
MongoDB FabLab León
Juan Antonio Roy Couto
 
PDF
Mongo db for c# developers
Simon Elliston Ball
 
MongoDB for Coder Training (Coding Serbia 2013)
Uwe Printz
 
London MongoDB User Group April 2011
Rainforest QA
 
Introduction to MongoDB – A NoSQL Database
manikgupta2k04
 
Seedhack MongoDB 2011
Rainforest QA
 
Mongo db basics
Dhaval Mistry
 
No SQL DB lecture showing structure and syntax
Georges Abboudeh
 
Mongo Nosql CRUD Operations
anujaggarwal49
 
9. Document Oriented Databases
Fabio Fumarola
 
MongoDB
techwhizbang
 
MongoDB - An Introduction
dinkar thakur
 
Mongo db basics
Harischandra M K
 
Mongo db
Girish Talekar
 
MongoDB
kesavan N B
 
Webinar: Building Your First App in Node.js
MongoDB
 
Webinar: Building Your First App in Node.js
MongoDB
 
MongoDB_ppt.pptx
1AP18CS037ShirishKul
 
MongoDB FabLab León
Juan Antonio Roy Couto
 
Mongo db for c# developers
Simon Elliston Ball
 
Ad

Recently uploaded (20)

PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Biography of Daniel Podor.pdf
Daniel Podor
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Biography of Daniel Podor.pdf
Daniel Podor
 
Ad

Mongodb ExpressJS HandlebarsJS NodeJS FullStack

  • 1. MEHN STACK By Narendranath Reddy Day 1 Theory…
  • 2. Name: Narendranath Reddy Thota  d3 Whitepaper Core Team  Trainer from Gama  Blockchain Full Stack Developer  Technology Analyst  Software Developer  Technology Speaker MAERSK Email: [email protected] P: +917288838869
  • 3. AGENDA Day 1: Full theory(MEHN) and mongodb practical Day 2: Full practical developing code from scratch MEHN Day3: Brief explanation on How complex code is, if we doesn't use handlebars JS in our app some theory on popular java scripts and demo on vanilla script.
  • 5. NOSQL • Key-value • Graph database • Document-oriented • Column family
  • 21. RDBMS MongoDB Database Database Table, View Collection Row Document (JSON, BSON) Column Field Index Index Join Embedded Document Foreign Key Reference Partition Shard > db.user.findOne({age:39}) { "_id" : ObjectId("5114e0bd42…"), "first" : "John", "last" : "Doe", "age" : 39, "interests" : [ "Reading", "Mountain Biking ] "favorites": { "color": "Blue", "sport": "Soccer"} }
  • 22. CRUD • Create • db.collection.insert( <document> ) • db.collection.save( <document> ) • db.collection.update( <query>, <update>, { upsert: true } ) • Read • db.collection.find( <query>, <projection> ) • db.collection.findOne( <query>, <projection> ) • Update • db.collection.update( <query>, <update>, <options> ) • Delete • db.collection.remove( <query>, <justOne> ) 22 Projection?
  • 23. INSERT VS INSERTONE • Insert (deprecated) • insertOne • insertMany MongoDB's update() and save() methods are used to update document into a collection. Update vs save Update: changes an existing document found by your find-parameters and does nothing when no such document exist (unless you use the upsert = true option). Save: doesn't allow any find-parameters. It checks if there is a document with the same _id as the one you save exists. When it exists, it replaces it. When no such document exists, it inserts the document as a new one.
  • 24. CRUD EXAMPLE 24 > db.user.insert({ first: "John", last : "Doe", age: 39 }) > db.user.find () { "_id" : ObjectId("51…"), "first" : "John", "last" : "Doe", "age" : 39 } > db.user.update( {"_id" : ObjectId("51…")}, { $set: { age: 40, salary: 7000} } ) > db.user.remove({ "first": /^J/ })
  • 25. FEATURES • Document-Oriented storege • Full Index Support • Replication & High Availability • Auto-Sharding • Querying • Fast In-Place Updates • Map/Reduce 25 Agile Scalable Auto-Sharding ?
  • 26. INSTALLATION• https://www.mongodb.com/download-center#enterprise • Two ways to start • 1: Normal way • mongodb –dbpath D:mongodatadb • mongo • 2: Background as a service Command1: Mongod --directoryperdb –dbpath D:mongodatadb --logpath D:mongologmongo.log –logappend –rest --install Command 2: Net start MongoDB
  • 27. LIVE DEMO IN MONGO CLIENT •Mongodb major developer Operations Better will do this in practical session slot
  • 28. CONNECT MONGODB TO OUR APPvar url = "mongodb://localhost:27017/database-name"; var MongoClient =require('mongodb').MongoClient; List All: MongoClient.connect(url, function(err, db) { var result = []; if (err) throw err; var cursor =db.collection('mehn').find({}); cursor.forEach(function(doc, err) { result.push(doc); }, function() { db.close(); }); });
  • 44. OTHER WAYS… var express = require('express'); var app = express(); var server = app.listen(8085, function () { var host = server.address().address var port = server.address().port console.log("Example app listening at http://%s:%s", host, port) })
  • 49. "plugins" known as middleware. https://stephensugden.com/middleware_guide/
  • 61. EXPRESS-HANDLEBARS var express = require('express'); var path = require('path'); var app = express(); // View Engine var exphbs = require('express-handlebars'); app.set('views', path.join(__dirname, 'views')); app.engine('handlebars',exphbs({defaultLayout:'layout'})); app.set('view engine', 'handlebars'); //end view Engine for handlebars
  • 62. STEPS: • 1) make new newfolder – npm init • 2) mention all required packages in package.json • 3) npm install • 4) structure • – views folder • layouts folder • layout(default)file Home.handlebars-file Login.handlebars-file . ├── app.js └── views ├── home.handlebars └── layouts └── main.handlebars 2 directories, 3 files
  • 63. PACKAGE NAMES: • "dependencies": { • "body-parser": "*", • "express": "*", • "express-handlebars": "*", • "file-system": "^2.2.2", • "express-validator": "^4.2.1", • "mongodb": "*", • "node-dev": "^3.1.3" // Auto restart - server • }
  • 65. THANK YOU. Day2 Practical Demo From the scratch in front of you CRUD Operation Pre – requisites: Nodejs v8 Mongo dB Frameworks: Express HandlebarsJS

Editor's Notes

  • #6: Huge quantity of data => Distributed systems => expensive joins => New fields, new demands (graphs) => Different data strucutres: Simplier or more specific
  • #21: 2009: Initial release At now: version 2.2.3
  • #23: Create The field name _id is reserved for use as a primary key; its value must be unique in the collection, is immutable, and may be of any type other than an array. The field names cannot start with the $ character. The field names cannot contain the . character. Create with save If the <document> argument does not contain the _id field or contains an _id field with a value not in the collection, the save() method performs an insert of the document. Otherwise, the save() method performs an update. sds