SlideShare a Scribd company logo
W O R K S H O P
S E S S I O N # 0 2
M I S S F A R H A T
CONTENT
 Introduction to Mongoose
 Introduction to NodeJs
 Introduction to Express
 Schemas and Models
 Installation of Compass
 CRUD Operation using Compass
CRUD Operation using Mongoose
INTRODUCTIONTO MONGOOSE
Mongoose is an Object Data Modelling (ODM) library for MongoDB
and Node.js. It manages relationships between data, provides schema
validation, and is used to translate between objects in code and the
representation of those objects in MongoDB.
https://mongoosejs.com/
const mongoose = require('mongoose');
mongoose.connect(‘mongodb://localhost:27017/test', {useNewUrlParser: true,
useUnifiedTopology: true})
.then ( () => console.log("Successful Connected"))
.catch( (err) => console.log(err));
INTRODUCTIONTO NODEJS
Node.js is a platform built on Chrome's JavaScript runtime for easily
building fast and scalable network applications. Node.js uses an
event-driven, non-blocking I/O model that makes it lightweight and
efficient, perfect for data-intensive real-time applications that run
across distributed devices.
https://nodejs.org/en/
Version: Latest version
Packages install: npm init -y
npm install mongoose
For CheckVersion: node –v
For Run Program: node run start
INTRODUCTIONTO EXPRESS
Express.js is a free and open-source web application framework for
Node.js. It is used for designing and building web applications quickly
and easily.
https://expressjs.com/
SCHEMAS AND MODELS
SCHEMAS:
Everything in Mongoose starts with a Schema. Each schema maps to a
MongoDB collection and defines the shape of the documents within
that collections.
const aptechSchema = new mongoose.Schema({
name: String,
Email: String,
Age: Number,
Date: {
type: Date,
default : Date.now
}
});
SCHEMAS AND MODELS
MODELS:
Models are fancy constructors compiled from Schema definitions. An
instance of a model is called a document. Models are responsible for
creating and reading documents from the underlying MongoDB
database.
const Aptech = new mongoose.model("Aptech",aptechSchema);
INSTALLATION OF COMPASS
https://www.mongodb.com
/try/download/compass
GUI OF COMPASS
GUI OF COMPASS
GUI OF COMPASS
GUI OF COMPASS

More Related Content

PPT
Intro to mongo db
PPTX
Mongo db workshop # 01
PPTX
Intro To Mongo Db
PPTX
MongoDB 101
PPTX
Basics of MongoDB
PDF
An introduction to MongoDB
PPTX
Mongodb basics and architecture
ODP
Introduction to MongoDB
Intro to mongo db
Mongo db workshop # 01
Intro To Mongo Db
MongoDB 101
Basics of MongoDB
An introduction to MongoDB
Mongodb basics and architecture
Introduction to MongoDB

What's hot (20)

PPTX
MongoDB
PPTX
MongoDB presentation
PDF
Mongo db basics
PDF
Introduction to MongoDB
PPTX
Top 10 frameworks of node js
PPTX
Introduction to MongoDB
PPTX
The Basics of MongoDB
PPTX
Get expertise with mongo db
DOCX
Mongo db report
PDF
Mongodb tutorial at Easylearning Guru
PPTX
Mongo db intro.pptx
PPTX
MongoDB Schema Design by Examples
PPTX
MongoDB basics & Introduction
PPTX
Mongo DB 102
PPTX
Mongo db
PPT
Introduction to mongodb
KEY
MongoDB NYC Python
PPTX
Node js crash course session 5
PPTX
Mango Database - Web Development
PPTX
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
MongoDB
MongoDB presentation
Mongo db basics
Introduction to MongoDB
Top 10 frameworks of node js
Introduction to MongoDB
The Basics of MongoDB
Get expertise with mongo db
Mongo db report
Mongodb tutorial at Easylearning Guru
Mongo db intro.pptx
MongoDB Schema Design by Examples
MongoDB basics & Introduction
Mongo DB 102
Mongo db
Introduction to mongodb
MongoDB NYC Python
Node js crash course session 5
Mango Database - Web Development
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Ad

Similar to Mongo db workshop # 02 (20)

PPTX
Unit IV database intergration with node js
PPTX
Introduction-to-MongoDB with mongoose and Node
PPTX
MongoDB with Mongoose_ Schemas, CRUD & Error Handling.pptx
PDF
Getting started with node JS
PDF
Writing RESTful web services using Node.js
PDF
TDD a REST API With Node.js and MongoDB
PDF
Developing and Testing a MongoDB and Node.js REST API
PDF
Basic API Creation with Node.JS
PDF
Download full ebook of Mean Web Development 2nd Amos Q Haviv instant download...
PPTX
Connect to NoSQL Database (MongoDB) using Node JS & Connect Node.js with NoSQ...
PDF
Backend Basic in nodejs express and mongodb PPT.pdf
PPTX
Enhanced CRUD Operations with Mongoose in Node.js
PPTX
Means stack course in pune(etlhive)
PPTX
MongoDB World 2018: Tutorial - MongoDB & NodeJS: Zero to Hero in 80 Minutes
PPTX
How to learn MongoDB for beginner's
PPTX
Node js Introduction
PDF
How to build microservices with node.js
PDF
Intro to Node.js
PDF
Web Development with AngularJS, NodeJS and ExpressJS
PPTX
nodejs.pptx
Unit IV database intergration with node js
Introduction-to-MongoDB with mongoose and Node
MongoDB with Mongoose_ Schemas, CRUD & Error Handling.pptx
Getting started with node JS
Writing RESTful web services using Node.js
TDD a REST API With Node.js and MongoDB
Developing and Testing a MongoDB and Node.js REST API
Basic API Creation with Node.JS
Download full ebook of Mean Web Development 2nd Amos Q Haviv instant download...
Connect to NoSQL Database (MongoDB) using Node JS & Connect Node.js with NoSQ...
Backend Basic in nodejs express and mongodb PPT.pdf
Enhanced CRUD Operations with Mongoose in Node.js
Means stack course in pune(etlhive)
MongoDB World 2018: Tutorial - MongoDB & NodeJS: Zero to Hero in 80 Minutes
How to learn MongoDB for beginner's
Node js Introduction
How to build microservices with node.js
Intro to Node.js
Web Development with AngularJS, NodeJS and ExpressJS
nodejs.pptx
Ad

Recently uploaded (20)

PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
top salesforce developer skills in 2025.pdf
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Nekopoi APK 2025 free lastest update
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PPTX
Introduction to Artificial Intelligence
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
medical staffing services at VALiNTRY
PPTX
L1 - Introduction to python Backend.pptx
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
System and Network Administraation Chapter 3
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
Transform Your Business with a Software ERP System
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Internet Downloader Manager (IDM) Crack 6.42 Build 41
top salesforce developer skills in 2025.pdf
Design an Analysis of Algorithms I-SECS-1021-03
wealthsignaloriginal-com-DS-text-... (1).pdf
Nekopoi APK 2025 free lastest update
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Introduction to Artificial Intelligence
Operating system designcfffgfgggggggvggggggggg
CHAPTER 2 - PM Management and IT Context
medical staffing services at VALiNTRY
L1 - Introduction to python Backend.pptx
Reimagine Home Health with the Power of Agentic AI​
Which alternative to Crystal Reports is best for small or large businesses.pdf
System and Network Administraation Chapter 3
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Transform Your Business with a Software ERP System
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus

Mongo db workshop # 02

  • 1. W O R K S H O P S E S S I O N # 0 2 M I S S F A R H A T
  • 2. CONTENT  Introduction to Mongoose  Introduction to NodeJs  Introduction to Express  Schemas and Models  Installation of Compass  CRUD Operation using Compass CRUD Operation using Mongoose
  • 3. INTRODUCTIONTO MONGOOSE Mongoose is an Object Data Modelling (ODM) library for MongoDB and Node.js. It manages relationships between data, provides schema validation, and is used to translate between objects in code and the representation of those objects in MongoDB. https://mongoosejs.com/ const mongoose = require('mongoose'); mongoose.connect(‘mongodb://localhost:27017/test', {useNewUrlParser: true, useUnifiedTopology: true}) .then ( () => console.log("Successful Connected")) .catch( (err) => console.log(err));
  • 4. INTRODUCTIONTO NODEJS Node.js is a platform built on Chrome's JavaScript runtime for easily building fast and scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices. https://nodejs.org/en/ Version: Latest version Packages install: npm init -y npm install mongoose For CheckVersion: node –v For Run Program: node run start
  • 5. INTRODUCTIONTO EXPRESS Express.js is a free and open-source web application framework for Node.js. It is used for designing and building web applications quickly and easily. https://expressjs.com/
  • 6. SCHEMAS AND MODELS SCHEMAS: Everything in Mongoose starts with a Schema. Each schema maps to a MongoDB collection and defines the shape of the documents within that collections. const aptechSchema = new mongoose.Schema({ name: String, Email: String, Age: Number, Date: { type: Date, default : Date.now } });
  • 7. SCHEMAS AND MODELS MODELS: Models are fancy constructors compiled from Schema definitions. An instance of a model is called a document. Models are responsible for creating and reading documents from the underlying MongoDB database. const Aptech = new mongoose.model("Aptech",aptechSchema);