SlideShare a Scribd company logo
Introduction to
MongoDB
MongoDB is a popular open-source NoSQL database that uses a
document-oriented data model. It provides high performance, high
availability, and easy scalability. MongoDB eliminates the need for an
Object-Relational Mapping (ORM), making it easier for developers to
store and access data.
by Prakash Singh
What is MongoDB?
1 Scalability
MongoDB allows
horizontal scaling
through sharding, which
distributes data across
multiple machines.
2 Flexibility
It supports various data
types and provides
dynamic schema design,
making it especially
useful for agile
development.
3 Performance
With in-memory
computing and native
JSON support,
MongoDB offers fast
read and write
operations.
Advantages of using MongoDB
Document Storage
Stores data in flexible, JSON-like documents
which can vary in structure, offering a more
natural representation of data.
Scalability
Easily scales out to handle larger amounts of
data and high throughput.
Introduction to Mongoose
1 Object Modeling
Mongoose provides a straightforward,
schema-based solution to model
application data.
2 Validation
It supports built-in data validation, ensuring
data integrity and consistency.
What is Mongoose?
Data Modeling
Mongoose allows for easy definition of
schemas and models for MongoDB
collections.
Middleware Support
Enables custom and predefined
operations before or after certain
events.
How to connect MongoDB with Node.js
using Mongoose
Install Mongoose
Use npm to install Mongoose
package for Node.js.
Setup Connection
Establish a connection
between Node.js and
MongoDB using Mongoose.
CRUD Operations
Perform create, read,
update, and delete
operations using Mongoose
with MongoDB.
Basics of Node.js
10K
Community
Node.js has a large and active community
providing extensive support and resources.
3
Event-Driven Architecture
Node.js utilizes an event-driven, non-blocking I/O
model, making it lightweight and efficient.
Introduction to Node.js
Environment Node.js provides an environment for executing
JavaScript code on the server-side.
Libraries It offers a rich repository of libraries to extend
its functionality and features.
Setting up a Node.js project
1 Initialize Project
Use npm init command to create the initial project structure.
2 Install Dependencies
Use npm to install necessary packages such as express and mongoose.
3 Create Server
Write code to create a server using Node.js and set up the routes.
Basics of querying MongoDB using
Mongoose
1 Find() Method
Use Mongoose's find() method to
query data based on specific
conditions.
2 Update() Method
Modify existing data in MongoDB
using Mongoose's update() method.

More Related Content

PDF
Node Js, AngularJs and Express Js Tutorial
PDF
MongoDB
PPTX
Unit IV database intergration with node js
PDF
Introduction to MongoDB Basics from SQL to NoSQL
PDF
Mongodb tutorial
ODP
Introduction to MongoDB
PPTX
MongoDB presentation
PPTX
How to learn MongoDB for beginner's
Node Js, AngularJs and Express Js Tutorial
MongoDB
Unit IV database intergration with node js
Introduction to MongoDB Basics from SQL to NoSQL
Mongodb tutorial
Introduction to MongoDB
MongoDB presentation
How to learn MongoDB for beginner's

Similar to Introduction-to-MongoDB with mongoose and Node (20)

PDF
Mongodb tutorial
PDF
3-Mongodb and Mapreduce Programming.pdf
PPTX
Kalp Corporate MongoDB Tutorials
PPTX
Introduction to MongoDB a brief intro(1).pptx
PDF
MongoDB and crud operations with nosql_ppt.pdf
PPTX
Mongodb Introduction
PPTX
Introduction to MongoDB.pptx
PPTX
Introduction To MongoDB
PPTX
Mongo db Quick Guide
PPTX
MongoDB_Sharan_Prakash_Babu
PDF
MongoDB - An Introduction
PPTX
Node js crash course session 5
PDF
Introduction to MongoDB
PPTX
mongodb_Introduction
PPTX
MongoDbPpt based on python installation.
PPTX
MongoDB
PPTX
MongoDB
PDF
Mongodb By Vipin
DOCX
MongoDB DOC v1.5
Mongodb tutorial
3-Mongodb and Mapreduce Programming.pdf
Kalp Corporate MongoDB Tutorials
Introduction to MongoDB a brief intro(1).pptx
MongoDB and crud operations with nosql_ppt.pdf
Mongodb Introduction
Introduction to MongoDB.pptx
Introduction To MongoDB
Mongo db Quick Guide
MongoDB_Sharan_Prakash_Babu
MongoDB - An Introduction
Node js crash course session 5
Introduction to MongoDB
mongodb_Introduction
MongoDbPpt based on python installation.
MongoDB
MongoDB
Mongodb By Vipin
MongoDB DOC v1.5
Ad

Recently uploaded (20)

PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
Lesson notes of climatology university.
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PPTX
Cell Structure & Organelles in detailed.
PDF
Computing-Curriculum for Schools in Ghana
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Weekly quiz Compilation Jan -July 25.pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Lesson notes of climatology university.
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Cell Structure & Organelles in detailed.
Computing-Curriculum for Schools in Ghana
Chinmaya Tiranga quiz Grand Finale.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
GDM (1) (1).pptx small presentation for students
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Weekly quiz Compilation Jan -July 25.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Ad

Introduction-to-MongoDB with mongoose and Node

  • 1. Introduction to MongoDB MongoDB is a popular open-source NoSQL database that uses a document-oriented data model. It provides high performance, high availability, and easy scalability. MongoDB eliminates the need for an Object-Relational Mapping (ORM), making it easier for developers to store and access data. by Prakash Singh
  • 2. What is MongoDB? 1 Scalability MongoDB allows horizontal scaling through sharding, which distributes data across multiple machines. 2 Flexibility It supports various data types and provides dynamic schema design, making it especially useful for agile development. 3 Performance With in-memory computing and native JSON support, MongoDB offers fast read and write operations.
  • 3. Advantages of using MongoDB Document Storage Stores data in flexible, JSON-like documents which can vary in structure, offering a more natural representation of data. Scalability Easily scales out to handle larger amounts of data and high throughput.
  • 4. Introduction to Mongoose 1 Object Modeling Mongoose provides a straightforward, schema-based solution to model application data. 2 Validation It supports built-in data validation, ensuring data integrity and consistency.
  • 5. What is Mongoose? Data Modeling Mongoose allows for easy definition of schemas and models for MongoDB collections. Middleware Support Enables custom and predefined operations before or after certain events.
  • 6. How to connect MongoDB with Node.js using Mongoose Install Mongoose Use npm to install Mongoose package for Node.js. Setup Connection Establish a connection between Node.js and MongoDB using Mongoose. CRUD Operations Perform create, read, update, and delete operations using Mongoose with MongoDB.
  • 7. Basics of Node.js 10K Community Node.js has a large and active community providing extensive support and resources. 3 Event-Driven Architecture Node.js utilizes an event-driven, non-blocking I/O model, making it lightweight and efficient.
  • 8. Introduction to Node.js Environment Node.js provides an environment for executing JavaScript code on the server-side. Libraries It offers a rich repository of libraries to extend its functionality and features.
  • 9. Setting up a Node.js project 1 Initialize Project Use npm init command to create the initial project structure. 2 Install Dependencies Use npm to install necessary packages such as express and mongoose. 3 Create Server Write code to create a server using Node.js and set up the routes.
  • 10. Basics of querying MongoDB using Mongoose 1 Find() Method Use Mongoose's find() method to query data based on specific conditions. 2 Update() Method Modify existing data in MongoDB using Mongoose's update() method.