SlideShare une entreprise Scribd logo
1  sur  14
By Priti Solanki
This presentation is to give you a quick way to start with Mongo shell
Tips
How to list all database
How to create empty database
How to view collections within mongo db
> use ninja//Your db name
switched to db ninja
> show collections
system.indexes
ninja
How to find details of specific ninja
db.ninja.find({'codename':'Sakura'})
{ "_id" : ObjectId("534e5c3b17d860326a37faa0"), "codename" :
"Sakura", "name" : [ { "firstname" : "Sakura", "lastname" : "Haruno"
} ], "rank" : "Chunin", "team" : [ "Team kakashi", "Eight Man Squad"
], "classification" : [ "Medical-nin" ], "Jutsu" : [ "Chakra Enhanced
strength", "Cherry Blossom Impact", "Yin seal" ] }
Can’t read let’s make it pretty….
db.ninja.find({'codename':'Sakura'}).pretty() and checkout the
output 
> db.ninja.find({'codename':'Naruto'}).pretty()
{
"Jutsu" : [
"Fire Dragon Missile",
"Earth Landslide",
"Black Rain",
"Secret Tree",
"Time reversal",
"Water wall"
],
"_id" : ObjectId("534e5fde17d860326a37faa1"),
"clan" : "Uzumaki Clan",
"classification" : [
"Jinchuriki",
"Pseudo-Jinchuriki",
"Sage"
],
"codename" : "Naruto",
"name" : [
{
"firstname" : "Naruto",
"lastname" : "Uzumaki"
}
],
"naturetype" : [
"wind release",
"lava release",
"yin-yang release"
],
"rank" : "genin",
"team" : [
"Team kakashi",
"Sasuke retireval team"
]
}
How to update specific document
As we say, have you noticed Sakura collection show "Jutsu" not
"naturetype".
>db.ninja.update({'codename':'Naruto'},{$set:{'Jutsu':["Fire Dragon
Missile","Earth Landslide","Black Rain","Secret Tree","Time
reversal","Water wall"]}}
How to remove document?
>db.ninja.remove({"codename":"Sakura"})
How to remove all documents in a collection?
>db.ninja.remove({})
How to delete collection
>db.ninja.drop()
So now, you can perform some of the basic operation on mongo db
via mongo shell
I hope these basic queries help you to give a good start
I have added dummy documents in next slides. So that you can
practice more by adding these documents
To improve this tutorial for beginners please share your comments
on pritiatwork@gmail.com
Dummy Document
>db.ninja.save({codename:"Naruto",name:[{firstname:"Naruto",lastname:"Uz
umaki"}],rank:"genin",team:["Team kakashi","Sasuke retireval
team"],classification:["Jinchuriki","Pseudo-Jinchuriki","Sage"],clan:"Uzumaki
Clan",naturetype:["wind release","lava release","yin-yang release"]})
>db.ninja.save({codename:"Sakura",name:[{firstname:"Sakura",lastname:"Har
uno"}],rank:"Chunin",team:["Team kakashi","Eight Man
Squad"],classification:["Medical-nin"],Jutsu:["Chakra Enhanced
strength","Cherry Blossom Impact","Yin seal"]})
>db.ninja.save({codename:"Sasuke",name:[{firstname:"Sasuke",lastname:"Uc
hiha"}],rank:"Genin",team:["Team kakashi","Sound
Four","Taka"],classification:["Missing-nin"],Jutsu:["Amaterasu","Body Flame
Technique","Chindori"]},naturetype:["Blaze release","Fire release","Lightning
release"])
MongoDB-Beginner tutorial explaining basic operation via mongo shell
MongoDB-Beginner tutorial explaining basic operation via mongo shell

Contenu connexe

Tendances

MongoD Essentials
MongoD EssentialsMongoD Essentials
MongoD Essentialszahid-mian
 
Serial Killers - or Deserialization for fun and profit
Serial Killers - or Deserialization for fun and profitSerial Killers - or Deserialization for fun and profit
Serial Killers - or Deserialization for fun and profitblaufish
 
MongoDB: Replication,Sharding,MapReduce
MongoDB: Replication,Sharding,MapReduceMongoDB: Replication,Sharding,MapReduce
MongoDB: Replication,Sharding,MapReduceTakahiro Inoue
 
Geospatial Indexing and Querying with MongoDB
Geospatial Indexing and Querying with MongoDBGeospatial Indexing and Querying with MongoDB
Geospatial Indexing and Querying with MongoDBGrant Goodale
 
اسلاید سوم جلسه هفتم کلاس پایتون برای هکرهای قانونی
اسلاید سوم جلسه هفتم کلاس پایتون برای هکرهای قانونیاسلاید سوم جلسه هفتم کلاس پایتون برای هکرهای قانونی
اسلاید سوم جلسه هفتم کلاس پایتون برای هکرهای قانونیMohammad Reza Kamalifard
 
jSession #3 - Krzysztof Czajkowski - Lombok in Java
jSession #3 - Krzysztof Czajkowski - Lombok in JavajSession #3 - Krzysztof Czajkowski - Lombok in Java
jSession #3 - Krzysztof Czajkowski - Lombok in JavajSession
 
Rapid and Scalable Development with MongoDB, PyMongo, and Ming
Rapid and Scalable Development with MongoDB, PyMongo, and MingRapid and Scalable Development with MongoDB, PyMongo, and Ming
Rapid and Scalable Development with MongoDB, PyMongo, and MingRick Copeland
 
Implementation Specifications
Implementation SpecificationsImplementation Specifications
Implementation SpecificationsUnmon Mukherjee
 
Micro(Lightweight) Django
Micro(Lightweight) DjangoMicro(Lightweight) Django
Micro(Lightweight) DjangoGrigory Petrov
 
To infinity and beyond
To infinity and beyondTo infinity and beyond
To infinity and beyondclintongormley
 

Tendances (11)

MongoD Essentials
MongoD EssentialsMongoD Essentials
MongoD Essentials
 
Serial Killers - or Deserialization for fun and profit
Serial Killers - or Deserialization for fun and profitSerial Killers - or Deserialization for fun and profit
Serial Killers - or Deserialization for fun and profit
 
MongoDB: Replication,Sharding,MapReduce
MongoDB: Replication,Sharding,MapReduceMongoDB: Replication,Sharding,MapReduce
MongoDB: Replication,Sharding,MapReduce
 
Geospatial Indexing and Querying with MongoDB
Geospatial Indexing and Querying with MongoDBGeospatial Indexing and Querying with MongoDB
Geospatial Indexing and Querying with MongoDB
 
اسلاید سوم جلسه هفتم کلاس پایتون برای هکرهای قانونی
اسلاید سوم جلسه هفتم کلاس پایتون برای هکرهای قانونیاسلاید سوم جلسه هفتم کلاس پایتون برای هکرهای قانونی
اسلاید سوم جلسه هفتم کلاس پایتون برای هکرهای قانونی
 
jSession #3 - Krzysztof Czajkowski - Lombok in Java
jSession #3 - Krzysztof Czajkowski - Lombok in JavajSession #3 - Krzysztof Czajkowski - Lombok in Java
jSession #3 - Krzysztof Czajkowski - Lombok in Java
 
Rapid and Scalable Development with MongoDB, PyMongo, and Ming
Rapid and Scalable Development with MongoDB, PyMongo, and MingRapid and Scalable Development with MongoDB, PyMongo, and Ming
Rapid and Scalable Development with MongoDB, PyMongo, and Ming
 
MongoDB-SESSION03
MongoDB-SESSION03MongoDB-SESSION03
MongoDB-SESSION03
 
Implementation Specifications
Implementation SpecificationsImplementation Specifications
Implementation Specifications
 
Micro(Lightweight) Django
Micro(Lightweight) DjangoMicro(Lightweight) Django
Micro(Lightweight) Django
 
To infinity and beyond
To infinity and beyondTo infinity and beyond
To infinity and beyond
 

En vedette

Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorialsMongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorialsSpringPeople
 
Intro To MongoDB
Intro To MongoDBIntro To MongoDB
Intro To MongoDBAlex Sharp
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBRavi Teja
 
Intro To Mongo Db
Intro To Mongo DbIntro To Mongo Db
Intro To Mongo Dbchriskite
 
Business considerations for node.js applications
Business considerations for node.js applicationsBusiness considerations for node.js applications
Business considerations for node.js applicationsAspenware
 
Getting Started with MongoDB and Node.js
Getting Started with MongoDB and Node.jsGetting Started with MongoDB and Node.js
Getting Started with MongoDB and Node.jsGrant Goodale
 
Mongo db tutorials
Mongo db tutorialsMongo db tutorials
Mongo db tutorialsAnuj Jain
 
Administration (Eliot Horowitz)
Administration (Eliot Horowitz)Administration (Eliot Horowitz)
Administration (Eliot Horowitz)MongoSF
 
Shankar's mongo db presentation
Shankar's mongo db presentationShankar's mongo db presentation
Shankar's mongo db presentationShankar Kamble
 
Connecting NodeJS & MongoDB
Connecting NodeJS & MongoDBConnecting NodeJS & MongoDB
Connecting NodeJS & MongoDBEnoch Joshua
 
NoSQL databases - An introduction
NoSQL databases - An introductionNoSQL databases - An introduction
NoSQL databases - An introductionPooyan Mehrparvar
 
MongoDB for Beginners
MongoDB for BeginnersMongoDB for Beginners
MongoDB for BeginnersEnoch Joshua
 

En vedette (20)

Mongo DB
Mongo DB Mongo DB
Mongo DB
 
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorialsMongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
 
Intro To MongoDB
Intro To MongoDBIntro To MongoDB
Intro To MongoDB
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Intro To Mongo Db
Intro To Mongo DbIntro To Mongo Db
Intro To Mongo Db
 
Business considerations for node.js applications
Business considerations for node.js applicationsBusiness considerations for node.js applications
Business considerations for node.js applications
 
Getting Started with MongoDB and Node.js
Getting Started with MongoDB and Node.jsGetting Started with MongoDB and Node.js
Getting Started with MongoDB and Node.js
 
Mongo db tutorials
Mongo db tutorialsMongo db tutorials
Mongo db tutorials
 
Administration (Eliot Horowitz)
Administration (Eliot Horowitz)Administration (Eliot Horowitz)
Administration (Eliot Horowitz)
 
MediaGlu and Mongo DB
MediaGlu and Mongo DBMediaGlu and Mongo DB
MediaGlu and Mongo DB
 
Shankar's mongo db presentation
Shankar's mongo db presentationShankar's mongo db presentation
Shankar's mongo db presentation
 
Mongo db basics
Mongo db basicsMongo db basics
Mongo db basics
 
Mongo db basics
Mongo db basicsMongo db basics
Mongo db basics
 
Connecting NodeJS & MongoDB
Connecting NodeJS & MongoDBConnecting NodeJS & MongoDB
Connecting NodeJS & MongoDB
 
NOSQL Overview
NOSQL OverviewNOSQL Overview
NOSQL Overview
 
NoSQL databases - An introduction
NoSQL databases - An introductionNoSQL databases - An introduction
NoSQL databases - An introduction
 
Mongo db
Mongo dbMongo db
Mongo db
 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
 
MongoDB for Beginners
MongoDB for BeginnersMongoDB for Beginners
MongoDB for Beginners
 
Mongo DB
Mongo DBMongo DB
Mongo DB
 

Dernier

Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 

Dernier (20)

Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 

MongoDB-Beginner tutorial explaining basic operation via mongo shell

  • 1. By Priti Solanki This presentation is to give you a quick way to start with Mongo shell
  • 2.
  • 4. How to list all database
  • 5. How to create empty database
  • 6. How to view collections within mongo db > use ninja//Your db name switched to db ninja > show collections system.indexes ninja
  • 7. How to find details of specific ninja db.ninja.find({'codename':'Sakura'}) { "_id" : ObjectId("534e5c3b17d860326a37faa0"), "codename" : "Sakura", "name" : [ { "firstname" : "Sakura", "lastname" : "Haruno" } ], "rank" : "Chunin", "team" : [ "Team kakashi", "Eight Man Squad" ], "classification" : [ "Medical-nin" ], "Jutsu" : [ "Chakra Enhanced strength", "Cherry Blossom Impact", "Yin seal" ] } Can’t read let’s make it pretty…. db.ninja.find({'codename':'Sakura'}).pretty() and checkout the output 
  • 8. > db.ninja.find({'codename':'Naruto'}).pretty() { "Jutsu" : [ "Fire Dragon Missile", "Earth Landslide", "Black Rain", "Secret Tree", "Time reversal", "Water wall" ], "_id" : ObjectId("534e5fde17d860326a37faa1"), "clan" : "Uzumaki Clan", "classification" : [ "Jinchuriki", "Pseudo-Jinchuriki", "Sage" ], "codename" : "Naruto", "name" : [ { "firstname" : "Naruto", "lastname" : "Uzumaki" } ], "naturetype" : [ "wind release", "lava release", "yin-yang release" ], "rank" : "genin", "team" : [ "Team kakashi", "Sasuke retireval team" ] }
  • 9. How to update specific document As we say, have you noticed Sakura collection show "Jutsu" not "naturetype". >db.ninja.update({'codename':'Naruto'},{$set:{'Jutsu':["Fire Dragon Missile","Earth Landslide","Black Rain","Secret Tree","Time reversal","Water wall"]}}
  • 10. How to remove document? >db.ninja.remove({"codename":"Sakura"}) How to remove all documents in a collection? >db.ninja.remove({}) How to delete collection >db.ninja.drop()
  • 11. So now, you can perform some of the basic operation on mongo db via mongo shell I hope these basic queries help you to give a good start I have added dummy documents in next slides. So that you can practice more by adding these documents To improve this tutorial for beginners please share your comments on pritiatwork@gmail.com
  • 12. Dummy Document >db.ninja.save({codename:"Naruto",name:[{firstname:"Naruto",lastname:"Uz umaki"}],rank:"genin",team:["Team kakashi","Sasuke retireval team"],classification:["Jinchuriki","Pseudo-Jinchuriki","Sage"],clan:"Uzumaki Clan",naturetype:["wind release","lava release","yin-yang release"]}) >db.ninja.save({codename:"Sakura",name:[{firstname:"Sakura",lastname:"Har uno"}],rank:"Chunin",team:["Team kakashi","Eight Man Squad"],classification:["Medical-nin"],Jutsu:["Chakra Enhanced strength","Cherry Blossom Impact","Yin seal"]}) >db.ninja.save({codename:"Sasuke",name:[{firstname:"Sasuke",lastname:"Uc hiha"}],rank:"Genin",team:["Team kakashi","Sound Four","Taka"],classification:["Missing-nin"],Jutsu:["Amaterasu","Body Flame Technique","Chindori"]},naturetype:["Blaze release","Fire release","Lightning release"])