SlideShare uma empresa Scribd logo
1 de 26
IntroductionToMongodb
Agenda
What is No-SQL?
Why choose No-SQL?
MongoDB
Installation Guide
Configuration Guide
Common Database Commands
CRUD in MongoDB
Hello!
I am Vijay Shukla
You can find me at:
vijay@nexthoughts.com
1.
WhatisnoSql?
Not Only SQL Database.
A form of Data Base Managment System which is non-
relational.
Systems are often schema less, avoid joins and easy to scale.
Term NoSQL was coined in 1998, by Carlo Strozzi and again in
early 2009 with no:sql east confrence.
The better term would have been “No REL”, but NoSQL
caught on.
Redis, MongoDB, CouchDB, are type of NoSQL
Whychoosenosql
Amountofdatastoredisontheupandup
EasyDistribution
Key-Value(k-V)stores
Documentstores
Non-relational andschema-lessdatamodel
Lowlatencyandhighperformance
Highscalability
Reference:- https://www.devbridge.com/articles/benefits-of-nosql/
MongoDB
MongoDB is an open source document database that provides high
performance, high availability and automatic scaling.
A record in MongoDB is a document, which is a data structure
composed of fields and value pairs.
MongoDB objects are very similar to JSON Objects.
{
Name:”vijay”,
Age:23,
}
Installation Guide
1. Import public key used by package management system
a. sudo apt-key adv --keyserver
hkp://keyserver.ubuntu.com:80 --recv EA312927
1. Create a list file for MongoDB
a. echo "deb http://repo.mongodb.org/apt/ubuntu
precise/mongodb-org/3.2 multiverse" | sudo tee
/etc/apt/sources.list.d/mongodb-org-3.2.list
1. Reload local package database
a. sudo apt-get update
1. Install MongoDB packages
a. sudo apt-get install -y mongodb-org
1. Install a specific release
a. sudo apt-get install -y mongodb-org=3.2.4 mongodb-org-
server=3.2.4 mongodb-org-shell=3.2.4 mongodb-org-
mongos=3.2.4 mongodb-org-tools=3.2.4
Installation Guide
Starting MongoDB Service
Mongod
Once we have issue this command, MongoDB will start
up and you should see:
waiting for connections on port 27017
Connecting to Mongodb Service
mongo
However, after all the steps above and mongodb installed in our
machine, now if you try to start the mongodb service sudo service
mongod start it will fail.
"start: Unable to connect to Upstart: Failed to connect to socket
/com/ubuntu/upstart: Connection refused”
Failed to start mongod.service: Unit mongod.service failed to load:
No such file or directory.
You probably will be able to manually start it with sudo mongod -f
/etc/mongod.conf - but in this way MongoDB will remain connected as long as that
terminal is opened.
Configuration Guide
1. First we are going to change MongoDB’s default data store files from
/var/lib/mongodb to/data/db
1. So, first create a folder /data/db in your machine. Run sudo mkdir -p
/data/db
1. Now open the main mongo configuration file with sudo gedit
/etc/mongod.conf and change the “dbpath” line as below
1. Replace dbpath=/var/lib/mongodb TO dbpath=/data/db and then save
the file.
1. Then delete the old default /var/lib/mongodb
1. But the directory you created doesn’t have the correct permissions and
ownership right after creation – it needs to be writable by the user who
runs the MongoDB process. Hence we must make all the directories/files
owned by mongod user
1. Run sudo chown -R mongodb:mongodb /data/db
Configuration Guide
Document Structure
MongoDb Command
Basic Commands
show dbs List All Databases
use db_name Change DB or Create DB
db Show current selected database name
save Create both the database and collection
find Read
update Update
remove Delete
✖ Create
db.collection.insert(<document>)
db.collection.save(<document>)
db.collection.update( <query>, <update>, { upsert: true })
✖ Read
db.collection.find( <query>, <projection> )
db.collection.findOne( <query>, <projection> )
✖ Update
db.collection.update( <query>, <update>, <options> )
✖ Delete
db.collection.remove( <query>, <justOne> )
// save one user
$ db.users.save({ name: 'Chris' });
// save multiple users
$ db.users.save([{ name: 'Chris'}, { name: 'Holly' }]);
Create
Read
// show all users
$ db.users.find();
// find a specific user
$ db.users.find({ name: 'Holly' });
db.users.update({ name: 'Holly' }, { name: 'Holly Lloyd' });
Update
Delete
// remove all
db.users.remove({});
// remove one
db.users.remove({ name: 'Holly' });
ToBeContinue...
Theory of noSQL: CAP
What is Sharding?
ACID - BASE
How to store large file (>16 MB)
Grails Project with MONGODB
What Next
Thanks!
Any questions?

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

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
 
Mongo DB
Mongo DB Mongo DB
Mongo DB
 
MongoDB
MongoDBMongoDB
MongoDB
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
MongoDB
MongoDBMongoDB
MongoDB
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Mongo db1
Mongo db1Mongo db1
Mongo db1
 
MongoDB 101
MongoDB 101MongoDB 101
MongoDB 101
 
The Basics of MongoDB
The Basics of MongoDBThe Basics of MongoDB
The Basics of MongoDB
 
Mongo db
Mongo dbMongo db
Mongo db
 
Mongo DB
Mongo DBMongo DB
Mongo DB
 
Benefits of using MongoDB: Reduce Complexity & Adapt to Changes
Benefits of using MongoDB: Reduce Complexity & Adapt to ChangesBenefits of using MongoDB: Reduce Complexity & Adapt to Changes
Benefits of using MongoDB: Reduce Complexity & Adapt to Changes
 
Mongo DB 102
Mongo DB 102Mongo DB 102
Mongo DB 102
 
Top 10 frameworks of node js
Top 10 frameworks of node jsTop 10 frameworks of node js
Top 10 frameworks of node js
 
Mongo db intro.pptx
Mongo db intro.pptxMongo db intro.pptx
Mongo db intro.pptx
 
Mongodb
MongodbMongodb
Mongodb
 
MongoDB presentation
MongoDB presentationMongoDB presentation
MongoDB presentation
 
Mongo db dhruba
Mongo db dhrubaMongo db dhruba
Mongo db dhruba
 
MongoDB Pros and Cons
MongoDB Pros and ConsMongoDB Pros and Cons
MongoDB Pros and Cons
 

Destaque (20)

Groovy intro
Groovy introGroovy intro
Groovy intro
 
Groovy
GroovyGroovy
Groovy
 
Meta Programming in Groovy
Meta Programming in GroovyMeta Programming in Groovy
Meta Programming in Groovy
 
Docker
DockerDocker
Docker
 
Unit test-using-spock in Grails
Unit test-using-spock in GrailsUnit test-using-spock in Grails
Unit test-using-spock in Grails
 
Java reflection
Java reflectionJava reflection
Java reflection
 
Actors model in gpars
Actors model in gparsActors model in gpars
Actors model in gpars
 
MetaProgramming with Groovy
MetaProgramming with GroovyMetaProgramming with Groovy
MetaProgramming with Groovy
 
Grails Controllers
Grails ControllersGrails Controllers
Grails Controllers
 
Grails services
Grails servicesGrails services
Grails services
 
Grails with swagger
Grails with swaggerGrails with swagger
Grails with swagger
 
Groovy DSL
Groovy DSLGroovy DSL
Groovy DSL
 
Grails domain classes
Grails domain classesGrails domain classes
Grails domain classes
 
Command objects
Command objectsCommand objects
Command objects
 
RESTEasy
RESTEasyRESTEasy
RESTEasy
 
Reactive java - Reactive Programming + RxJava
Reactive java - Reactive Programming + RxJavaReactive java - Reactive Programming + RxJava
Reactive java - Reactive Programming + RxJava
 
Introduction to thymeleaf
Introduction to thymeleafIntroduction to thymeleaf
Introduction to thymeleaf
 
Apache tika
Apache tikaApache tika
Apache tika
 
Introduction to mongo db
Introduction to mongo dbIntroduction to mongo db
Introduction to mongo db
 
Introduction to mongo db by zain
Introduction to mongo db by zainIntroduction to mongo db by zain
Introduction to mongo db by zain
 

Semelhante a Introduction to mongo db

mongodb11 (1) (1).pptx
mongodb11 (1) (1).pptxmongodb11 (1) (1).pptx
mongodb11 (1) (1).pptxRoopaR36
 
The Little MongoDB Book - Karl Seguin
The Little MongoDB Book - Karl SeguinThe Little MongoDB Book - Karl Seguin
The Little MongoDB Book - Karl SeguinPaulo Fagundes
 
Node Js, AngularJs and Express Js Tutorial
Node Js, AngularJs and Express Js TutorialNode Js, AngularJs and Express Js Tutorial
Node Js, AngularJs and Express Js TutorialPHP Support
 
MongoDB Introduction - Document Oriented Nosql Database
MongoDB Introduction - Document Oriented Nosql DatabaseMongoDB Introduction - Document Oriented Nosql Database
MongoDB Introduction - Document Oriented Nosql DatabaseSudhir Patil
 
Pros and Cons of MongoDB in Web Development
Pros and Cons of MongoDB in Web DevelopmentPros and Cons of MongoDB in Web Development
Pros and Cons of MongoDB in Web DevelopmentNirvana Canada
 
MongoDB - An Introduction
MongoDB - An IntroductionMongoDB - An Introduction
MongoDB - An Introductiondinkar thakur
 
Mdb dn 2016_07_elastic_search
Mdb dn 2016_07_elastic_searchMdb dn 2016_07_elastic_search
Mdb dn 2016_07_elastic_searchDaniel M. Farrell
 
MongoDB - An Introduction
MongoDB - An IntroductionMongoDB - An Introduction
MongoDB - An Introductionsethfloydjr
 
introtomongodb
introtomongodbintrotomongodb
introtomongodbsaikiran
 
MongoDB Lab Manual (1).pdf used in data science
MongoDB Lab Manual (1).pdf used in data scienceMongoDB Lab Manual (1).pdf used in data science
MongoDB Lab Manual (1).pdf used in data sciencebitragowthamkumar1
 
how_can_businesses_address_storage_issues_using_mongodb.pptx
how_can_businesses_address_storage_issues_using_mongodb.pptxhow_can_businesses_address_storage_issues_using_mongodb.pptx
how_can_businesses_address_storage_issues_using_mongodb.pptxsarah david
 
how_can_businesses_address_storage_issues_using_mongodb.pdf
how_can_businesses_address_storage_issues_using_mongodb.pdfhow_can_businesses_address_storage_issues_using_mongodb.pdf
how_can_businesses_address_storage_issues_using_mongodb.pdfsarah david
 

Semelhante a Introduction to mongo db (20)

Mongodb
MongodbMongodb
Mongodb
 
Mongodb
MongodbMongodb
Mongodb
 
mongodb11 (1) (1).pptx
mongodb11 (1) (1).pptxmongodb11 (1) (1).pptx
mongodb11 (1) (1).pptx
 
MongoDB
MongoDBMongoDB
MongoDB
 
Mongo DB
Mongo DBMongo DB
Mongo DB
 
The Little MongoDB Book - Karl Seguin
The Little MongoDB Book - Karl SeguinThe Little MongoDB Book - Karl Seguin
The Little MongoDB Book - Karl Seguin
 
Node Js, AngularJs and Express Js Tutorial
Node Js, AngularJs and Express Js TutorialNode Js, AngularJs and Express Js Tutorial
Node Js, AngularJs and Express Js Tutorial
 
MongoDB Introduction - Document Oriented Nosql Database
MongoDB Introduction - Document Oriented Nosql DatabaseMongoDB Introduction - Document Oriented Nosql Database
MongoDB Introduction - Document Oriented Nosql Database
 
10 mongo db
10 mongo db10 mongo db
10 mongo db
 
Pros and Cons of MongoDB in Web Development
Pros and Cons of MongoDB in Web DevelopmentPros and Cons of MongoDB in Web Development
Pros and Cons of MongoDB in Web Development
 
Mongo db
Mongo dbMongo db
Mongo db
 
MongoDB - An Introduction
MongoDB - An IntroductionMongoDB - An Introduction
MongoDB - An Introduction
 
Mdb dn 2016_07_elastic_search
Mdb dn 2016_07_elastic_searchMdb dn 2016_07_elastic_search
Mdb dn 2016_07_elastic_search
 
MongoDB - An Introduction
MongoDB - An IntroductionMongoDB - An Introduction
MongoDB - An Introduction
 
Mongo db report
Mongo db reportMongo db report
Mongo db report
 
introtomongodb
introtomongodbintrotomongodb
introtomongodb
 
MongoDB Lab Manual (1).pdf used in data science
MongoDB Lab Manual (1).pdf used in data scienceMongoDB Lab Manual (1).pdf used in data science
MongoDB Lab Manual (1).pdf used in data science
 
MongoDB.pptx
MongoDB.pptxMongoDB.pptx
MongoDB.pptx
 
how_can_businesses_address_storage_issues_using_mongodb.pptx
how_can_businesses_address_storage_issues_using_mongodb.pptxhow_can_businesses_address_storage_issues_using_mongodb.pptx
how_can_businesses_address_storage_issues_using_mongodb.pptx
 
how_can_businesses_address_storage_issues_using_mongodb.pdf
how_can_businesses_address_storage_issues_using_mongodb.pdfhow_can_businesses_address_storage_issues_using_mongodb.pdf
how_can_businesses_address_storage_issues_using_mongodb.pdf
 

Mais de NexThoughts Technologies (20)

Alexa skill
Alexa skillAlexa skill
Alexa skill
 
GraalVM
GraalVMGraalVM
GraalVM
 
Docker & kubernetes
Docker & kubernetesDocker & kubernetes
Docker & kubernetes
 
Apache commons
Apache commonsApache commons
Apache commons
 
HazelCast
HazelCastHazelCast
HazelCast
 
MySQL Pro
MySQL ProMySQL Pro
MySQL Pro
 
Microservice Architecture using Spring Boot with React & Redux
Microservice Architecture using Spring Boot with React & ReduxMicroservice Architecture using Spring Boot with React & Redux
Microservice Architecture using Spring Boot with React & Redux
 
Swagger
SwaggerSwagger
Swagger
 
Solid Principles
Solid PrinciplesSolid Principles
Solid Principles
 
Arango DB
Arango DBArango DB
Arango DB
 
Jython
JythonJython
Jython
 
Introduction to TypeScript
Introduction to TypeScriptIntroduction to TypeScript
Introduction to TypeScript
 
Smart Contract samples
Smart Contract samplesSmart Contract samples
Smart Contract samples
 
My Doc of geth
My Doc of gethMy Doc of geth
My Doc of geth
 
Geth important commands
Geth important commandsGeth important commands
Geth important commands
 
Ethereum genesis
Ethereum genesisEthereum genesis
Ethereum genesis
 
Ethereum
EthereumEthereum
Ethereum
 
Springboot Microservices
Springboot MicroservicesSpringboot Microservices
Springboot Microservices
 
An Introduction to Redux
An Introduction to ReduxAn Introduction to Redux
An Introduction to Redux
 
Google authentication
Google authenticationGoogle authentication
Google authentication
 

Último

OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyAnusha Are
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...Nitya salvi
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfryanfarris8
 

Último (20)

OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 

Introduction to mongo db

  • 2. Agenda What is No-SQL? Why choose No-SQL? MongoDB Installation Guide Configuration Guide Common Database Commands CRUD in MongoDB
  • 3. Hello! I am Vijay Shukla You can find me at: vijay@nexthoughts.com
  • 5. Not Only SQL Database. A form of Data Base Managment System which is non- relational. Systems are often schema less, avoid joins and easy to scale. Term NoSQL was coined in 1998, by Carlo Strozzi and again in early 2009 with no:sql east confrence. The better term would have been “No REL”, but NoSQL caught on. Redis, MongoDB, CouchDB, are type of NoSQL
  • 9. MongoDB is an open source document database that provides high performance, high availability and automatic scaling. A record in MongoDB is a document, which is a data structure composed of fields and value pairs. MongoDB objects are very similar to JSON Objects. { Name:”vijay”, Age:23, }
  • 11. 1. Import public key used by package management system a. sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 1. Create a list file for MongoDB a. echo "deb http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list 1. Reload local package database a. sudo apt-get update 1. Install MongoDB packages a. sudo apt-get install -y mongodb-org 1. Install a specific release a. sudo apt-get install -y mongodb-org=3.2.4 mongodb-org- server=3.2.4 mongodb-org-shell=3.2.4 mongodb-org- mongos=3.2.4 mongodb-org-tools=3.2.4 Installation Guide
  • 12. Starting MongoDB Service Mongod Once we have issue this command, MongoDB will start up and you should see: waiting for connections on port 27017 Connecting to Mongodb Service mongo
  • 13. However, after all the steps above and mongodb installed in our machine, now if you try to start the mongodb service sudo service mongod start it will fail. "start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused” Failed to start mongod.service: Unit mongod.service failed to load: No such file or directory. You probably will be able to manually start it with sudo mongod -f /etc/mongod.conf - but in this way MongoDB will remain connected as long as that terminal is opened. Configuration Guide
  • 14. 1. First we are going to change MongoDB’s default data store files from /var/lib/mongodb to/data/db 1. So, first create a folder /data/db in your machine. Run sudo mkdir -p /data/db 1. Now open the main mongo configuration file with sudo gedit /etc/mongod.conf and change the “dbpath” line as below 1. Replace dbpath=/var/lib/mongodb TO dbpath=/data/db and then save the file. 1. Then delete the old default /var/lib/mongodb 1. But the directory you created doesn’t have the correct permissions and ownership right after creation – it needs to be writable by the user who runs the MongoDB process. Hence we must make all the directories/files owned by mongod user 1. Run sudo chown -R mongodb:mongodb /data/db Configuration Guide
  • 17. Basic Commands show dbs List All Databases use db_name Change DB or Create DB db Show current selected database name save Create both the database and collection find Read update Update remove Delete
  • 18. ✖ Create db.collection.insert(<document>) db.collection.save(<document>) db.collection.update( <query>, <update>, { upsert: true }) ✖ Read db.collection.find( <query>, <projection> ) db.collection.findOne( <query>, <projection> ) ✖ Update db.collection.update( <query>, <update>, <options> ) ✖ Delete db.collection.remove( <query>, <justOne> )
  • 19. // save one user $ db.users.save({ name: 'Chris' }); // save multiple users $ db.users.save([{ name: 'Chris'}, { name: 'Holly' }]); Create Read // show all users $ db.users.find(); // find a specific user $ db.users.find({ name: 'Holly' });
  • 20. db.users.update({ name: 'Holly' }, { name: 'Holly Lloyd' }); Update Delete // remove all db.users.remove({}); // remove one db.users.remove({ name: 'Holly' });
  • 21.
  • 22.
  • 23.
  • 25. Theory of noSQL: CAP What is Sharding? ACID - BASE How to store large file (>16 MB) Grails Project with MONGODB What Next

Notas do Editor

  1. Latency is a time interval between the stimulation and response.