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)

PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Computing-Curriculum for Schools in Ghana
PPTX
GDM (1) (1).pptx small presentation for students
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Presentation on HIE in infants and its manifestations
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PPTX
Lesson notes of climatology university.
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
Institutional Correction lecture only . . .
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Complications of Minimal Access Surgery at WLH
Microbial disease of the cardiovascular and lymphatic systems
2.FourierTransform-ShortQuestionswithAnswers.pdf
VCE English Exam - Section C Student Revision Booklet
Computing-Curriculum for Schools in Ghana
GDM (1) (1).pptx small presentation for students
Anesthesia in Laparoscopic Surgery in India
Presentation on HIE in infants and its manifestations
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Lesson notes of climatology university.
102 student loan defaulters named and shamed – Is someone you know on the list?
O7-L3 Supply Chain Operations - ICLT Program
Institutional Correction lecture only . . .
STATICS OF THE RIGID BODIES Hibbelers.pdf
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Final Presentation General Medicine 03-08-2024.pptx
Complications of Minimal Access Surgery at WLH
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.