MongoDB 101
Session I Topics
• What is MongoDb?
• Introduction to JSON
• MongoDb Relative to Relational
• Setting up MongoDb on Windows
• Firing up the mongo shell
• Setting up RoboMongo
• Schema? What Schema?
What is MongoDB?
Non Relational
JSON
Document Store
MongoDB is a
Key features of MongoDB
Flexibility
stores data in JSON which
seamlessly maps to
programming languages.
Dynamic schema makes it
easier for your data model
to evolve.
Power
Secondary indexes,
dynamic queries, sorting,
rich updates, upserts
(update if document exists,
insert if doesn’t)
Functionality of RDBMS+
Horizontal scaling of
NRDBMS
Speed/Scaling
Queries are faster due to
non-relational data.
Autosharding allows scaling
your cluster linearly by
adding more machines.
Ease of Use
Easy to install, configure, maintain, and use.
Works right out of the box and you can dive right into app development
Why JSON?
JSONis open, human and machine-readable standard
Supports all basic datatypes: numbers, strings, boolean values, arrays
and hashes
No need for a fixed schema. Just add what you want.
Format is programmer friendly. Unlike you know… XML!
MongoDB uses BSON behind the scenes which is an extended format
for JSON
MongoDB reuses a Javascript engine for their queries. Makes complete
sense in the world to re-use JSON for object representation.
JSON Basics
Light weight, text-based open source standard for data interchange.
Based on a subset of Javascript
Fundamental structure of JSON
Collection of Key-
Value pairs
Array/List of items
{
“name”: “Abhijeet Vaikar”,
“designation”: “PA”,
“age”: 25
}
[“json”, “xml”, “bson”, “bxml”]
JSON Basics
var myArray = [ "John Doe",
29, true, null ];
var myArray2 = [
{ “name”: “John Doe”,
“age”:29},
{ “name”: “Anna Smith”, “age”:
24}
];
Try in console:
myArray[2] – true
myArray2[1].name – Anna Smith
More Arrays: More Objects:
var objectWithNestedArray = {
“name”: “John Doe”,
“interests”:[“Reading”,
“Mountain Biking”, “Hacking”]
};
var objectWithNestedObject =
{
“favorites” : {
“color” : “blue”,
“sport” : “Soccer”
}
};
Try in console:
objectWithNestedArray.interest
s[0] – Reading
objectWithNestedObject.favorit
es.color - blue
JSON Basics Demo
JSON Basics
JSON Specification link: www.json.org
Validate your JSON : www.jsonlint.com
Prettify/Format your JSON: www.jsonprettyprint.com
MongoDB documents
All data in MongoDB is stored as documents (JSON style data structures ).
A collection contains many documents.
Format: Data is stored on disk in BSON (Binary JSON) serialization format.
Document example:
{
_id: ObjectId("5099803df3f4948bd2f98391"),
name: { first: "Alan", last: "Turing" },
birth: new Date('Jun 23, 1912'),
death: new Date('Jun 07, 1954'),
contribs: [ "Turing machine", "Turing test", "Turingery" ]
}
Fields: Fields in a document cannot:
• Start with the dollar ( $ )character
• Contain the dot ( . ) character
• Contain the null character
Maximum document size is 16 megabytes.
Document fields order is maintained following write operations except for _id field
which will always be first.
MongoDB Relative to Relational
Depth of Functionality
Scalability&Performance
Memcached
Key Value stores
MongoDB
SQL Server / MySQL
Where does MongoDB fit?
Setting up MongoDB on Windows
1. Determine if your system is 32-bit / 64-bit and download and execute the setup
from http://www.mongodb.org/downloads. Follow the default steps.
2. Your setup will install mongodb in path C:Program FilesMongoDB 2.x Standard
3. Set environment variables for mongo and mongod processes for convenience
(optional)
4. Configure mongodb to set your data directory using the following command:
mongod.exe --dbpath d:testmongodbdata
5. Start command prompt and trigger mongo executable. You should see:
MongoDB shell version: 2.6.x
connecting to: test
6. Perform the following query for checking out if all is good:
db.poetry.insert({“name” : “Ba Ba Black Sheep”}); //Hit enter
db.poetry.find() //Hit enter
Setting up MongoDB on Windows
If you get the following output:
{
"_id" : ObjectId("542254b633fc68d796ef1867"),
"name" : "Ba Ba Black Sheep"
}
Then you can go like this:
Mongo Shell +
RoboMongo Demo
Schema? What Schema?
Data in MongoDB is schema less. Data model of a document can be modified as
needed.
Helps agile developers! 
{
“_id” : 0,
“height”: 480,
“width”:640,
“tags”: [
“dogs”, “work”
]
}
Document 1
{
“_id” : 1,
“name” : “Birthday”,
“height”: 450,
“width”:640,
“tags”: [
“baby”, “happy”
]
}
Document 2
{
“_id” : 2,
“name” : “Party”,
“height”: 480,
“width”:640,
“tags”: [
“office”, “party”
],
“rating”: 3
}
Document 3
Schemaless data
Demo

More Related Content

PPT
Introduction to mongodb
ODP
Introduction to MongoDB
PPTX
Introduction to MongoDB
PDF
An introduction to MongoDB
PPTX
Basics of MongoDB
PDF
An introduction to MongoDB
PPTX
Mongodb basics and architecture
PPTX
The Basics of MongoDB
Introduction to mongodb
Introduction to MongoDB
Introduction to MongoDB
An introduction to MongoDB
Basics of MongoDB
An introduction to MongoDB
Mongodb basics and architecture
The Basics of MongoDB

What's hot (20)

PPTX
Mongo db intro.pptx
PPTX
Mongo DB 102
PPTX
Introduction to MongoDB
PPTX
Mongo DB Presentation
PPTX
MongoDB presentation
PDF
MongodB Internals
PPTX
An Introduction To NoSQL & MongoDB
PPTX
MongoDB
PDF
MongoDB Fundamentals
PPTX
Indexing with MongoDB
PPTX
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
PDF
Intro To MongoDB
PPT
Introduction to MongoDB
PDF
Mongo db dhruba
DOCX
Mongo db report
PPTX
Mongo Nosql CRUD Operations
PPTX
Mongodb vs mysql
PDF
Inside MongoDB: the Internals of an Open-Source Database
Mongo db intro.pptx
Mongo DB 102
Introduction to MongoDB
Mongo DB Presentation
MongoDB presentation
MongodB Internals
An Introduction To NoSQL & MongoDB
MongoDB
MongoDB Fundamentals
Indexing with MongoDB
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Intro To MongoDB
Introduction to MongoDB
Mongo db dhruba
Mongo db report
Mongo Nosql CRUD Operations
Mongodb vs mysql
Inside MongoDB: the Internals of an Open-Source Database
Ad

Viewers also liked (12)

PPTX
Building Applications using MongoDB, Node.js and Socket.io
PPTX
Ops Jumpstart: MongoDB Administration 101
KEY
MongoDB Administration ~ Kevin Hanson
PPTX
Upgrading Mobile Tester's Weapons with Advanced Debugging
PDF
SpringPeople Introduction to MongoDB Administration
PDF
MongoDB Administration 101
KEY
OSCON 2012 MongoDB Tutorial
PPT
The Rest Architectural Style
KEY
NoSQL databases and managing big data
PDF
About Agile Testing Alliance (ATA)
PDF
Webinar: 10-Step Guide to Creating a Single View of your Business
PDF
10-Step Methodology to Building a Single View with MongoDB
Building Applications using MongoDB, Node.js and Socket.io
Ops Jumpstart: MongoDB Administration 101
MongoDB Administration ~ Kevin Hanson
Upgrading Mobile Tester's Weapons with Advanced Debugging
SpringPeople Introduction to MongoDB Administration
MongoDB Administration 101
OSCON 2012 MongoDB Tutorial
The Rest Architectural Style
NoSQL databases and managing big data
About Agile Testing Alliance (ATA)
Webinar: 10-Step Guide to Creating a Single View of your Business
10-Step Methodology to Building a Single View with MongoDB
Ad

Similar to MongoDB 101 (20)

PDF
Building your first app with MongoDB
PPTX
Mongodb Introduction
PPTX
MongoDB Schema Design: Practical Applications and Implications
KEY
Introduction to MongoDB
PDF
MongoDB and Ruby on Rails
PPTX
Dev Jumpstart: Build Your First App with MongoDB
KEY
PPTX
PDF
MongoDB for Coder Training (Coding Serbia 2013)
PDF
Back to Basics 2017: Mí primera aplicación MongoDB
PPTX
Dev Jumpstart: Build Your First App with MongoDB
PPTX
Webinar: General Technical Overview of MongoDB for Dev Teams
PPTX
Back to Basics, webinar 2: La tua prima applicazione MongoDB
PDF
MongoDB
PDF
Building your first app with mongo db
PPTX
Sekilas PHP + mongoDB
PDF
Webinar: Was ist neu in MongoDB 2.4
PPTX
Back to Basics Webinar 2 - Your First MongoDB Application
PPTX
Back to Basics Webinar 2: Your First MongoDB Application
PPTX
Streaming Data Pipelines with MongoDB and Kafka at ao.com
Building your first app with MongoDB
Mongodb Introduction
MongoDB Schema Design: Practical Applications and Implications
Introduction to MongoDB
MongoDB and Ruby on Rails
Dev Jumpstart: Build Your First App with MongoDB
MongoDB for Coder Training (Coding Serbia 2013)
Back to Basics 2017: Mí primera aplicación MongoDB
Dev Jumpstart: Build Your First App with MongoDB
Webinar: General Technical Overview of MongoDB for Dev Teams
Back to Basics, webinar 2: La tua prima applicazione MongoDB
MongoDB
Building your first app with mongo db
Sekilas PHP + mongoDB
Webinar: Was ist neu in MongoDB 2.4
Back to Basics Webinar 2 - Your First MongoDB Application
Back to Basics Webinar 2: Your First MongoDB Application
Streaming Data Pipelines with MongoDB and Kafka at ao.com

Recently uploaded (20)

PDF
Workplace Software and Skills - OpenStax
PDF
Website Design & Development_ Professional Web Design Services.pdf
PDF
Understanding the Need for Systemic Change in Open Source Through Intersectio...
PPTX
Computer Software - Technology and Livelihood Education
PPTX
Full-Stack Developer Courses That Actually Land You Jobs
PDF
BoxLang Dynamic AWS Lambda - Japan Edition
PDF
AI-Powered Fuzz Testing: The Future of QA
PPTX
Airline CRS | Airline CRS Systems | CRS System
PPTX
Download Adobe Photoshop Crack 2025 Free
PPTX
ROI Analysis for Newspaper Industry with Odoo ERP
PDF
Cloud Native Aachen Meetup - Aug 21, 2025
PPTX
HackYourBrain__UtrechtJUG__11092025.pptx
PPTX
string python Python Strings: Literals, Slicing, Methods, Formatting, and Pra...
PDF
PDF-XChange Editor Plus 10.7.0.398.0 Crack Free Download Latest 2025
PPTX
R-Studio Crack Free Download 2025 Latest
PPTX
Plex Media Server 1.28.2.6151 With Crac5 2022 Free .
PPTX
Cybersecurity-and-Fraud-Protecting-Your-Digital-Life.pptx
PPTX
Chapter 1 - Transaction Processing and Mgt.pptx
PDF
AI Guide for Business Growth - Arna Softech
PPTX
Bandicam Screen Recorder 8.2.1 Build 2529 Crack
Workplace Software and Skills - OpenStax
Website Design & Development_ Professional Web Design Services.pdf
Understanding the Need for Systemic Change in Open Source Through Intersectio...
Computer Software - Technology and Livelihood Education
Full-Stack Developer Courses That Actually Land You Jobs
BoxLang Dynamic AWS Lambda - Japan Edition
AI-Powered Fuzz Testing: The Future of QA
Airline CRS | Airline CRS Systems | CRS System
Download Adobe Photoshop Crack 2025 Free
ROI Analysis for Newspaper Industry with Odoo ERP
Cloud Native Aachen Meetup - Aug 21, 2025
HackYourBrain__UtrechtJUG__11092025.pptx
string python Python Strings: Literals, Slicing, Methods, Formatting, and Pra...
PDF-XChange Editor Plus 10.7.0.398.0 Crack Free Download Latest 2025
R-Studio Crack Free Download 2025 Latest
Plex Media Server 1.28.2.6151 With Crac5 2022 Free .
Cybersecurity-and-Fraud-Protecting-Your-Digital-Life.pptx
Chapter 1 - Transaction Processing and Mgt.pptx
AI Guide for Business Growth - Arna Softech
Bandicam Screen Recorder 8.2.1 Build 2529 Crack

MongoDB 101

  • 2. Session I Topics • What is MongoDb? • Introduction to JSON • MongoDb Relative to Relational • Setting up MongoDb on Windows • Firing up the mongo shell • Setting up RoboMongo • Schema? What Schema?
  • 3. What is MongoDB? Non Relational JSON Document Store MongoDB is a
  • 4. Key features of MongoDB Flexibility stores data in JSON which seamlessly maps to programming languages. Dynamic schema makes it easier for your data model to evolve. Power Secondary indexes, dynamic queries, sorting, rich updates, upserts (update if document exists, insert if doesn’t) Functionality of RDBMS+ Horizontal scaling of NRDBMS Speed/Scaling Queries are faster due to non-relational data. Autosharding allows scaling your cluster linearly by adding more machines. Ease of Use Easy to install, configure, maintain, and use. Works right out of the box and you can dive right into app development
  • 5. Why JSON? JSONis open, human and machine-readable standard Supports all basic datatypes: numbers, strings, boolean values, arrays and hashes No need for a fixed schema. Just add what you want. Format is programmer friendly. Unlike you know… XML! MongoDB uses BSON behind the scenes which is an extended format for JSON MongoDB reuses a Javascript engine for their queries. Makes complete sense in the world to re-use JSON for object representation.
  • 6. JSON Basics Light weight, text-based open source standard for data interchange. Based on a subset of Javascript Fundamental structure of JSON Collection of Key- Value pairs Array/List of items { “name”: “Abhijeet Vaikar”, “designation”: “PA”, “age”: 25 } [“json”, “xml”, “bson”, “bxml”]
  • 7. JSON Basics var myArray = [ "John Doe", 29, true, null ]; var myArray2 = [ { “name”: “John Doe”, “age”:29}, { “name”: “Anna Smith”, “age”: 24} ]; Try in console: myArray[2] – true myArray2[1].name – Anna Smith More Arrays: More Objects: var objectWithNestedArray = { “name”: “John Doe”, “interests”:[“Reading”, “Mountain Biking”, “Hacking”] }; var objectWithNestedObject = { “favorites” : { “color” : “blue”, “sport” : “Soccer” } }; Try in console: objectWithNestedArray.interest s[0] – Reading objectWithNestedObject.favorit es.color - blue
  • 9. JSON Basics JSON Specification link: www.json.org Validate your JSON : www.jsonlint.com Prettify/Format your JSON: www.jsonprettyprint.com
  • 10. MongoDB documents All data in MongoDB is stored as documents (JSON style data structures ). A collection contains many documents. Format: Data is stored on disk in BSON (Binary JSON) serialization format. Document example: { _id: ObjectId("5099803df3f4948bd2f98391"), name: { first: "Alan", last: "Turing" }, birth: new Date('Jun 23, 1912'), death: new Date('Jun 07, 1954'), contribs: [ "Turing machine", "Turing test", "Turingery" ] } Fields: Fields in a document cannot: • Start with the dollar ( $ )character • Contain the dot ( . ) character • Contain the null character Maximum document size is 16 megabytes. Document fields order is maintained following write operations except for _id field which will always be first.
  • 11. MongoDB Relative to Relational Depth of Functionality Scalability&Performance Memcached Key Value stores MongoDB SQL Server / MySQL Where does MongoDB fit?
  • 12. Setting up MongoDB on Windows 1. Determine if your system is 32-bit / 64-bit and download and execute the setup from http://www.mongodb.org/downloads. Follow the default steps. 2. Your setup will install mongodb in path C:Program FilesMongoDB 2.x Standard 3. Set environment variables for mongo and mongod processes for convenience (optional) 4. Configure mongodb to set your data directory using the following command: mongod.exe --dbpath d:testmongodbdata 5. Start command prompt and trigger mongo executable. You should see: MongoDB shell version: 2.6.x connecting to: test 6. Perform the following query for checking out if all is good: db.poetry.insert({“name” : “Ba Ba Black Sheep”}); //Hit enter db.poetry.find() //Hit enter
  • 13. Setting up MongoDB on Windows If you get the following output: { "_id" : ObjectId("542254b633fc68d796ef1867"), "name" : "Ba Ba Black Sheep" } Then you can go like this:
  • 15. Schema? What Schema? Data in MongoDB is schema less. Data model of a document can be modified as needed. Helps agile developers!  { “_id” : 0, “height”: 480, “width”:640, “tags”: [ “dogs”, “work” ] } Document 1 { “_id” : 1, “name” : “Birthday”, “height”: 450, “width”:640, “tags”: [ “baby”, “happy” ] } Document 2 { “_id” : 2, “name” : “Party”, “height”: 480, “width”:640, “tags”: [ “office”, “party” ], “rating”: 3 } Document 3