SlideShare a Scribd company logo
MongoDB in 20 Minutes
Valeri Karpov
Software Engineer, MongoDB
www.thecodebarbarian.com
www.slideshare.net/vkarpov15
github.com/vkarpov15
@code_barbarian
*
Who am I?
•CI/NodeJS/Tools Engineer at MongoDB
•Maintainer of mongoose ODM
•Currently working on new mongodb tools
•Contributor to NodeJS and Go drivers
•Princeton CS ‘11
*
MongoDB
The leading NoSQL database
Document
Database
Open-SourceGeneral
Purpose
*
•Big banks: Goldman Sachs, Citi, DB
•News: Business Insider, Forbes, NYT
•Hackathon Tools: Trello, Github, Sourceforge
•HackPrinceton sponsors: Sailthru, Buzzfeed,
Facebook (and MongoDB of course)
•Odds are, you have interacted with MongoDB
today
Who Uses It?
*
What’s MongoDB About?
*
RDBMS
Store Objects, Not Columns
MongoDB
{
_id : ObjectId("4c4ba5e5e8aabf3"),
employee_name: "Dunham, Justin",
department : "Marketing",
title : "Product Manager, Web",
report_up: "Neray, Graham",
pay_band: “C",
benefits : [
{ type : "Health",
plan : "PPO Plus" },
{ type : "Dental",
plan : "Standard" }
]
}
*
Better Data Locality
High Performance
In-Memory Caching In-Place Updates
*
Scales Vertically and Horizontally
Auto-Sharding
*
Durable
•Automated replication and failover
•Multi-data center support
•Data remains consistent
*
Shell
Command-line shell for
interacting directly with
database
Write Code in Your Favorite
Language
Drivers
Drivers for most popular
programming languages and
frameworks
> db.collection.insert({product:“MongoDB”, type:
“Document Database”})
>
> db.collection.findOne()
{
“_id” : ObjectId(“5106c1c2fc629bfe52792e86”),
“product” : “MongoDB”
“type”: “Document Database”
}
Java
Python
Perl
Ruby
Haskell
JavaScript
*
Talk is Cheap: Lets Hack
•Download MongoDB 2.8.0-rc0 - fresh out of the oven
(11/12), still experimental
•Data set: cities in USA with latitude, longitude,
population based on 2010 census
•Download from my S3 bucket
•Going to use MongoDB shell to demo some cool
MongoDB features
•Can access these features from your language of
choice
*
Simple: How many people live in
Princeton?
*
Simple: How many towns called
Princeton in the US?
*
What are the 3 most populous
“Princetons” in the US?
*
Geo: 3 most populous towns within
10 miles of Princeton
*
Geo: Nearest Towns to Princeton that
Have “ville” in the name
*
Geo: Nearest Towns to Princeton that
Have “ville” in the name
*
Text Search: Most Populous Cities
with “Fall” in the name
*
Text Search and Geo Together
*
Aggregation: Transforming Data
•General idea of MongoDB: structure data to fit your
use case
•Aggregation framework allows you to take data and
transform it to better fit your use case
*
Example: Recreating Cities Data Set
•Cities data set actually transformed from zip codes
*
Example: Recreating Cities Data Set
•General idea to transform zips to cities:
• Group zips by city/state
• Sum up populations
• Take one of the locations
*
Example: Recreating Cities Data Set
*
Outputting Cities Data Set
MongoDB API Talk @ HackPrinceton

More Related Content

PDF
Web search - Political news analysis tool
PDF
An introduction to MongoDB
PDF
萌典與零時政府
PPTX
Arab Academy For Science And Technology
PPTX
Tutorial: Building Your First App with MongoDB Stitch
PPTX
Metrics that Matter: The 360-Degree Customer
PPTX
Introduction to MongoDB at IGDTUW
PPTX
Geoindexing with MongoDB
Web search - Political news analysis tool
An introduction to MongoDB
萌典與零時政府
Arab Academy For Science And Technology
Tutorial: Building Your First App with MongoDB Stitch
Metrics that Matter: The 360-Degree Customer
Introduction to MongoDB at IGDTUW
Geoindexing with MongoDB

Similar to MongoDB API Talk @ HackPrinceton (20)

PDF
Accra MongoDB User Group
PDF
From SQL to MongoDB
PDF
An Introduction to Mongo DB
PDF
MongoDB NoSQL database a deep dive -MyWhitePaper
PDF
OSDC 2012 | Building a first application on MongoDB by Ross Lawley
KEY
PDF
MongodB Internals
PDF
MongoDB Basics
PDF
Building Your First MongoDB Application
PPTX
PPTX
Mongo db 101 dc group
PDF
SQL vs NoSQL, an experiment with MongoDB
PPTX
introtomongodb
PPTX
MongoDB 3.4 webinar
PDF
Building Apps with MongoDB
PPTX
Jumpstart: Introduction to Schema Design
PPTX
Webinar: General Technical Overview of MongoDB for Dev Teams
PPTX
Introduction to MongoDB
PPT
Webinar: How MongoDB is making Government Better, Faster, Smarter
PPTX
MongoDB Evenings Minneapolis: MongoDB is Cool But When Should I Use It?
Accra MongoDB User Group
From SQL to MongoDB
An Introduction to Mongo DB
MongoDB NoSQL database a deep dive -MyWhitePaper
OSDC 2012 | Building a first application on MongoDB by Ross Lawley
MongodB Internals
MongoDB Basics
Building Your First MongoDB Application
Mongo db 101 dc group
SQL vs NoSQL, an experiment with MongoDB
introtomongodb
MongoDB 3.4 webinar
Building Apps with MongoDB
Jumpstart: Introduction to Schema Design
Webinar: General Technical Overview of MongoDB for Dev Teams
Introduction to MongoDB
Webinar: How MongoDB is making Government Better, Faster, Smarter
MongoDB Evenings Minneapolis: MongoDB is Cool But When Should I Use It?

More from Valeri Karpov (20)

PDF
A Practical Introduction to GeoJSON
PDF
A Practical Introduction to Functions-as-a-Service
PDF
A Gentle Introduction to Functions-as-a-Service
PDF
Introducing Async/Await
PDF
TAO and the Essence of Modern JavaScript
PDF
Mastering Async/Await in JavaScript
PDF
React, Redux, and Archetype
PDF
TDD a REST API With Node.js and MongoDB
PDF
Conquering AngularJS Limitations
PDF
MongoDB MEAN Stack Webinar October 7, 2015
PDF
MEAN Stack NYC Meetup 20150717: TDD Your AngularJS + Ionic Directives With jQ...
PDF
Lessons in Open Source from the MongooseJS ODM
PDF
Nimrod: MongoDB Shell in NodeJS (JSConfUY 2015)
PDF
MongoDB Miami Meetup 1/26/15: Introduction to WiredTiger
PDF
MEAN Stack WeNode Barcelona Workshop
PDF
MongoDB Israel June Meetup
PDF
JS-IL: Getting MEAN in 1 Hour
PDF
JS-IL Keynote: MongoDB 2.6, Mongoose 4.0, and Beyond
PDF
MEAN Stack Workshop at Node Philly, 4/9/14
PDF
MongoDB: Queries and Aggregation Framework with NBA Game Data
A Practical Introduction to GeoJSON
A Practical Introduction to Functions-as-a-Service
A Gentle Introduction to Functions-as-a-Service
Introducing Async/Await
TAO and the Essence of Modern JavaScript
Mastering Async/Await in JavaScript
React, Redux, and Archetype
TDD a REST API With Node.js and MongoDB
Conquering AngularJS Limitations
MongoDB MEAN Stack Webinar October 7, 2015
MEAN Stack NYC Meetup 20150717: TDD Your AngularJS + Ionic Directives With jQ...
Lessons in Open Source from the MongooseJS ODM
Nimrod: MongoDB Shell in NodeJS (JSConfUY 2015)
MongoDB Miami Meetup 1/26/15: Introduction to WiredTiger
MEAN Stack WeNode Barcelona Workshop
MongoDB Israel June Meetup
JS-IL: Getting MEAN in 1 Hour
JS-IL Keynote: MongoDB 2.6, Mongoose 4.0, and Beyond
MEAN Stack Workshop at Node Philly, 4/9/14
MongoDB: Queries and Aggregation Framework with NBA Game Data

Recently uploaded (20)

PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Encapsulation theory and applications.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Empathic Computing: Creating Shared Understanding
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Electronic commerce courselecture one. Pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Review of recent advances in non-invasive hemoglobin estimation
Dropbox Q2 2025 Financial Results & Investor Presentation
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Encapsulation theory and applications.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Empathic Computing: Creating Shared Understanding
MYSQL Presentation for SQL database connectivity
sap open course for s4hana steps from ECC to s4
20250228 LYD VKU AI Blended-Learning.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Chapter 3 Spatial Domain Image Processing.pdf
Unlocking AI with Model Context Protocol (MCP)
Electronic commerce courselecture one. Pdf
A comparative analysis of optical character recognition models for extracting...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Building Integrated photovoltaic BIPV_UPV.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Review of recent advances in non-invasive hemoglobin estimation

MongoDB API Talk @ HackPrinceton

  • 1. MongoDB in 20 Minutes Valeri Karpov Software Engineer, MongoDB www.thecodebarbarian.com www.slideshare.net/vkarpov15 github.com/vkarpov15 @code_barbarian
  • 2. * Who am I? •CI/NodeJS/Tools Engineer at MongoDB •Maintainer of mongoose ODM •Currently working on new mongodb tools •Contributor to NodeJS and Go drivers •Princeton CS ‘11
  • 3. * MongoDB The leading NoSQL database Document Database Open-SourceGeneral Purpose
  • 4. * •Big banks: Goldman Sachs, Citi, DB •News: Business Insider, Forbes, NYT •Hackathon Tools: Trello, Github, Sourceforge •HackPrinceton sponsors: Sailthru, Buzzfeed, Facebook (and MongoDB of course) •Odds are, you have interacted with MongoDB today Who Uses It?
  • 6. * RDBMS Store Objects, Not Columns MongoDB { _id : ObjectId("4c4ba5e5e8aabf3"), employee_name: "Dunham, Justin", department : "Marketing", title : "Product Manager, Web", report_up: "Neray, Graham", pay_band: “C", benefits : [ { type : "Health", plan : "PPO Plus" }, { type : "Dental", plan : "Standard" } ] }
  • 7. * Better Data Locality High Performance In-Memory Caching In-Place Updates
  • 8. * Scales Vertically and Horizontally Auto-Sharding
  • 9. * Durable •Automated replication and failover •Multi-data center support •Data remains consistent
  • 10. * Shell Command-line shell for interacting directly with database Write Code in Your Favorite Language Drivers Drivers for most popular programming languages and frameworks > db.collection.insert({product:“MongoDB”, type: “Document Database”}) > > db.collection.findOne() { “_id” : ObjectId(“5106c1c2fc629bfe52792e86”), “product” : “MongoDB” “type”: “Document Database” } Java Python Perl Ruby Haskell JavaScript
  • 11. * Talk is Cheap: Lets Hack •Download MongoDB 2.8.0-rc0 - fresh out of the oven (11/12), still experimental •Data set: cities in USA with latitude, longitude, population based on 2010 census •Download from my S3 bucket •Going to use MongoDB shell to demo some cool MongoDB features •Can access these features from your language of choice
  • 12. * Simple: How many people live in Princeton?
  • 13. * Simple: How many towns called Princeton in the US?
  • 14. * What are the 3 most populous “Princetons” in the US?
  • 15. * Geo: 3 most populous towns within 10 miles of Princeton
  • 16. * Geo: Nearest Towns to Princeton that Have “ville” in the name
  • 17. * Geo: Nearest Towns to Princeton that Have “ville” in the name
  • 18. * Text Search: Most Populous Cities with “Fall” in the name
  • 19. * Text Search and Geo Together
  • 20. * Aggregation: Transforming Data •General idea of MongoDB: structure data to fit your use case •Aggregation framework allows you to take data and transform it to better fit your use case
  • 21. * Example: Recreating Cities Data Set •Cities data set actually transformed from zip codes
  • 22. * Example: Recreating Cities Data Set •General idea to transform zips to cities: • Group zips by city/state • Sum up populations • Take one of the locations