SlideShare a Scribd company logo
for Beginners
ABSTRACT
 This PPT will explain about the MONGODB concepts and using that can
achieve the CURD Operation.
What is MongoDB
 It is a Open source cross platform document oriented with the scalability
and flexible database.
 MongoDB is a distributed database at its core, so high availability,
horizontal scaling, and geographic distribution are built in and easy to use.
 Its Classified as NOSQL database program.
 There is no RDBMS Concept here and data’s are stored in a flat file system.
 MongoDB uses JSON-like documents with SCHEMA for creating a new
Table in the DB. 
Key Features:
 High Performance:
 Support for embedded data models reduces I/O activity on database system.
 Indexes support faster queries and can include keys from embedded documents and
arrays.
 Rich Query Language.
 High Availability: Automatic failover and data redundancy.
 Horizontal Scalability :
 Sharding distributes data across a cluster of machines.
 MongoDB 3.4 supports creating zones of data based on the shard key. In a balanced
cluster, MongoDB directs reads and writes covered by a zone only to those shards inside
the zone. See the Zones manual page for more information.
 Support for Multiple Storage Engines:
 WiredTiger Storage Engine
 MMAPV1 Storage Engine
 Creating dummy Collection
Example :
export var dummytable= new Mongo.Collection(null);
Where we use the MongoDB
 You need High Availability in an Unreliable Environment (Cloud and Real
Life)
 You need to Grow Big (and Shard Your Data)
 Your Data is Location Based
 Your Data Set is Going to be Big (starting from 1GB) and Schema is Not
Stable
 You Don't have a DBA
Comparison Between MYSQL and
MONGODB
List Of Companies Using MongoDB
Installation Steps for MongoDB
 It will support all Operating System. The below links will used for install the
mongoDB
https://docs.mongodb.com/manual/installation/
https://www.mongodb.com/
CREATE A NEW TABLE
 We have a create a new table in MongoDB using Schema.
 In that Schema it self we can add fields and there properties of the table.
 Sample Schema for create a new table in Mongo DB. File name eg :
SampleDB.js
var sampletable= new SimpleSchema({
id: {
type: Number,
label: "ID",
optional: true //It mean the field is Mandatory
},
name: {
type: String,
label: "Name",
optional: true
},
bloodgroup: {
type: String,
label: "BloodGroup",
},
phonenumber: {
type: Number,
label: "Phone Number",
optional: true
},
Date: {
type: Date,
label: "Phone Number",
optional: true
},
});
export const Test = new Mongo.Collection('test');
Test.attachSchema(sampletable);
STORE THE VALUE
 We can store the Value in MongoDB , using INSERT command.
 If we pass a array we can store in to Database.
 The below example contains both array and list the fields are passing to
store the value in Database.
Example : Array value is storing in DB
test.insert({
id: 12345,
name: ’Kesavan’,
bloodgroup:’o+ve’,
phonenumber:’9942591686’,
date:’20180707’
});
QUERY THE RECORD
 To read or query the record in the MongoDB , here its named as finding the record .
 We have to use find(), fetch(), count() and findAll() methods for search the value in
the table.
 find() : It will find the particular record for that we have to pass the _id unique
address of the record.
 fetch() : It will fetch the value for a particular record that we have to pass the _id
unique address of the record.
 count() : It will query the records based on the counts.
 Syntax:
find() and fetch()
db.collection_name.find({ObjectId(12 digit hashcode)}).fetch();
find() and count()
db.collection_name.find({ObjectId(12 digit hashcode)}).count();
Example:
db.test.find({ObjectId(7df78ad8902c)}).fetch()
db.test.find({ObjectId(7df78ad8902c)}).count()
findAll(): we will get all the records in the collection.
Syntax:
db.collection_name.findAll({ });
Example:
db.test.findAll({ }) ;
UPDATE THE VALUE
 For Update the existing record in the MongoDB , we have to use UPDATE
command .
 We can able to update group of record as well as particular record.
 Syntax:
db.collection_name.update({ _id:’value’,fieldname:fieldvalue });
 Example:
test.update({ _id: 7df78ad8902c,phonenumber:’+91-8825719818’})
REMOVE (or)DELETE THE RECORD
 To delete the records in the collection will use REMOVE and DELETE command.
REMOVE:
 It will remove single or multiple the records in the collection the details as below.
 SYNTAX:
db.collection_name.remove({_id});
 To remove the multiple records in the collection use the below logic.
Logic:
var noofrecord= db.collection_name.find().count();
for (i=0;i< noofrecord;i++){
var idval= i._id
db.collection_name.remove({idval});
}
DELETE:
It will delete single or multiple record in the collection the details as mentioned the below.
SYNTAX:
 Delete a single record in the collection.
db.collection_name.deleteOne({_id:ObjectId(“12 digit hash”)});
Example:
db.test.deleteOne({_id:ObjectId(“838383837312”)});
 Delete multiple records in the collection.
db.collection_name.deleteMany({fieldname:fieldvalue)});
Example:
db.test.deleteMany({bloodgroup:’0+ve’)});
DROP THE TABLE
 Using the drop() predefined method will able to delete the entire
collection.
 The below example is explaining about the delete the collection.
 Example:
test.drop()
REFERENCE
 https://www.mongodb.com/
 https://www.meteor.com/tutorials/blaze/collections
 http://meteortips.com/first-meteor-tutorial/databases-part-1/
Note: Based on the mongoDB version lot of methods and functions are
released to get all the updates refer the above links.

More Related Content

PDF
Mongo db basics
PPTX
Mongo DB Presentation
PPT
2011 mongo FR - scaling with mongodb
PPTX
Getting Started with MongoDB
PPTX
Mongo db
PPTX
MongoDB basics & Introduction
PPTX
Web Development Course - AJAX & JSON by RSOLUTIONS
PPTX
MongoDB for Beginners
Mongo db basics
Mongo DB Presentation
2011 mongo FR - scaling with mongodb
Getting Started with MongoDB
Mongo db
MongoDB basics & Introduction
Web Development Course - AJAX & JSON by RSOLUTIONS
MongoDB for Beginners

What's hot (19)

PDF
Mongodb Introduction
PDF
Superficial mongo db
PDF
Full metal mongo
PPTX
PPT
2011 Mongo FR - MongoDB introduction
PPTX
Mongo DB 102
PDF
New Features in Apache Pinot
ODP
Mongo indexes
PPS
MongoDB crud
PPTX
Get expertise with mongo db
PDF
Mongo db basics
PPTX
PPTX
PPTX
Tag based sharding presentation
KEY
MongoDB NYC Python
PDF
An introduction to MongoDB
PPT
MongoDb - Details on the POC
Mongodb Introduction
Superficial mongo db
Full metal mongo
2011 Mongo FR - MongoDB introduction
Mongo DB 102
New Features in Apache Pinot
Mongo indexes
MongoDB crud
Get expertise with mongo db
Mongo db basics
Tag based sharding presentation
MongoDB NYC Python
An introduction to MongoDB
MongoDb - Details on the POC
Ad

Similar to MongoDB (20)

PPTX
Introduction to MongoDB
PDF
MongoDB - An Introduction
PDF
Mongodb By Vipin
PPTX
MongoDB introduction features -presentation - 2.pptx
PPTX
Mongo db
PPTX
Basics of MongoDB
PPTX
Node js crash course session 5
PPTX
fard car.pptx
PPTX
Query Optimization in MongoDB
PDF
MongoDB
PPTX
Introduction to MongoDB – A NoSQL Database
PPTX
MongoDB-presentation.pptx
PPTX
Introduction to MongoDB.pptx
PPTX
mongo.pptx
PPTX
Mongodb introduction and_internal(simple)
PPTX
NOSQL and MongoDB Database
PPTX
Mongo db Quick Guide
PPTX
DBVersity MongoDB Online Training Presentations
PDF
MongoDB Interview Questions PDF By ScholarHat
PPTX
Mongodb - NoSql Database
Introduction to MongoDB
MongoDB - An Introduction
Mongodb By Vipin
MongoDB introduction features -presentation - 2.pptx
Mongo db
Basics of MongoDB
Node js crash course session 5
fard car.pptx
Query Optimization in MongoDB
MongoDB
Introduction to MongoDB – A NoSQL Database
MongoDB-presentation.pptx
Introduction to MongoDB.pptx
mongo.pptx
Mongodb introduction and_internal(simple)
NOSQL and MongoDB Database
Mongo db Quick Guide
DBVersity MongoDB Online Training Presentations
MongoDB Interview Questions PDF By ScholarHat
Mongodb - NoSql Database
Ad

Recently uploaded (20)

PPTX
Institutional Correction lecture only . . .
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
Lesson notes of climatology university.
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
A systematic review of self-coping strategies used by university students to ...
PPTX
GDM (1) (1).pptx small presentation for students
PDF
Classroom Observation Tools for Teachers
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PPTX
Cell Types and Its function , kingdom of life
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
Institutional Correction lecture only . . .
2.FourierTransform-ShortQuestionswithAnswers.pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Final Presentation General Medicine 03-08-2024.pptx
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Abdominal Access Techniques with Prof. Dr. R K Mishra
Lesson notes of climatology university.
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Anesthesia in Laparoscopic Surgery in India
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
A systematic review of self-coping strategies used by university students to ...
GDM (1) (1).pptx small presentation for students
Classroom Observation Tools for Teachers
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Cell Types and Its function , kingdom of life
Module 4: Burden of Disease Tutorial Slides S2 2025
Chinmaya Tiranga quiz Grand Finale.pdf
Supply Chain Operations Speaking Notes -ICLT Program
O5-L3 Freight Transport Ops (International) V1.pdf

MongoDB

  • 2. ABSTRACT  This PPT will explain about the MONGODB concepts and using that can achieve the CURD Operation.
  • 3. What is MongoDB  It is a Open source cross platform document oriented with the scalability and flexible database.  MongoDB is a distributed database at its core, so high availability, horizontal scaling, and geographic distribution are built in and easy to use.  Its Classified as NOSQL database program.  There is no RDBMS Concept here and data’s are stored in a flat file system.  MongoDB uses JSON-like documents with SCHEMA for creating a new Table in the DB. 
  • 4. Key Features:  High Performance:  Support for embedded data models reduces I/O activity on database system.  Indexes support faster queries and can include keys from embedded documents and arrays.  Rich Query Language.  High Availability: Automatic failover and data redundancy.  Horizontal Scalability :  Sharding distributes data across a cluster of machines.  MongoDB 3.4 supports creating zones of data based on the shard key. In a balanced cluster, MongoDB directs reads and writes covered by a zone only to those shards inside the zone. See the Zones manual page for more information.
  • 5.  Support for Multiple Storage Engines:  WiredTiger Storage Engine  MMAPV1 Storage Engine  Creating dummy Collection Example : export var dummytable= new Mongo.Collection(null);
  • 6. Where we use the MongoDB  You need High Availability in an Unreliable Environment (Cloud and Real Life)  You need to Grow Big (and Shard Your Data)  Your Data is Location Based  Your Data Set is Going to be Big (starting from 1GB) and Schema is Not Stable  You Don't have a DBA
  • 8. List Of Companies Using MongoDB
  • 9. Installation Steps for MongoDB  It will support all Operating System. The below links will used for install the mongoDB https://docs.mongodb.com/manual/installation/ https://www.mongodb.com/
  • 10. CREATE A NEW TABLE  We have a create a new table in MongoDB using Schema.  In that Schema it self we can add fields and there properties of the table.  Sample Schema for create a new table in Mongo DB. File name eg : SampleDB.js
  • 11. var sampletable= new SimpleSchema({ id: { type: Number, label: "ID", optional: true //It mean the field is Mandatory }, name: { type: String, label: "Name", optional: true }, bloodgroup: { type: String, label: "BloodGroup", }, phonenumber: { type: Number, label: "Phone Number", optional: true }, Date: { type: Date, label: "Phone Number", optional: true }, }); export const Test = new Mongo.Collection('test'); Test.attachSchema(sampletable);
  • 12. STORE THE VALUE  We can store the Value in MongoDB , using INSERT command.  If we pass a array we can store in to Database.  The below example contains both array and list the fields are passing to store the value in Database. Example : Array value is storing in DB
  • 14. QUERY THE RECORD  To read or query the record in the MongoDB , here its named as finding the record .  We have to use find(), fetch(), count() and findAll() methods for search the value in the table.  find() : It will find the particular record for that we have to pass the _id unique address of the record.  fetch() : It will fetch the value for a particular record that we have to pass the _id unique address of the record.  count() : It will query the records based on the counts.  Syntax: find() and fetch() db.collection_name.find({ObjectId(12 digit hashcode)}).fetch(); find() and count() db.collection_name.find({ObjectId(12 digit hashcode)}).count();
  • 15. Example: db.test.find({ObjectId(7df78ad8902c)}).fetch() db.test.find({ObjectId(7df78ad8902c)}).count() findAll(): we will get all the records in the collection. Syntax: db.collection_name.findAll({ }); Example: db.test.findAll({ }) ;
  • 16. UPDATE THE VALUE  For Update the existing record in the MongoDB , we have to use UPDATE command .  We can able to update group of record as well as particular record.  Syntax: db.collection_name.update({ _id:’value’,fieldname:fieldvalue });  Example: test.update({ _id: 7df78ad8902c,phonenumber:’+91-8825719818’})
  • 17. REMOVE (or)DELETE THE RECORD  To delete the records in the collection will use REMOVE and DELETE command. REMOVE:  It will remove single or multiple the records in the collection the details as below.  SYNTAX: db.collection_name.remove({_id});  To remove the multiple records in the collection use the below logic. Logic: var noofrecord= db.collection_name.find().count(); for (i=0;i< noofrecord;i++){ var idval= i._id db.collection_name.remove({idval}); }
  • 18. DELETE: It will delete single or multiple record in the collection the details as mentioned the below. SYNTAX:  Delete a single record in the collection. db.collection_name.deleteOne({_id:ObjectId(“12 digit hash”)}); Example: db.test.deleteOne({_id:ObjectId(“838383837312”)});  Delete multiple records in the collection. db.collection_name.deleteMany({fieldname:fieldvalue)}); Example: db.test.deleteMany({bloodgroup:’0+ve’)});
  • 19. DROP THE TABLE  Using the drop() predefined method will able to delete the entire collection.  The below example is explaining about the delete the collection.  Example: test.drop()
  • 20. REFERENCE  https://www.mongodb.com/  https://www.meteor.com/tutorials/blaze/collections  http://meteortips.com/first-meteor-tutorial/databases-part-1/ Note: Based on the mongoDB version lot of methods and functions are released to get all the updates refer the above links.