Upload
cesar-martinez
View
107
Download
3
Embed Size (px)
Citation preview
About Me• In search of my Zen programming language
• Computer Engineering Student
• President ACM-ECE 2012 - 2013
• Founder hackPR @ UPRM
• Opinionated
• @sezalcru
NoSQL- Non-relational database
- Documents, Key- Value pairs, Graphs and Objects
- Dynamic Schemas
- Store object in favor of tables
- Quick setup and integration
So, MongoDB- Document oriented, NoSQL
- Document structure is similar to JSON object
- Dynamic Schema
- Forgiving
- JavaScript query language
Go for MongoDB when…
- Developing a quick prototype
- Quick refactoring in development
- Non-relational data
- Log data
- Metadata
Re-think MongoDB if…
- Related data***
- Joins
- Redundancy will be an issue
- Performance can be an issue
***This is a biggie
Docs and Drivers
- Open Source Project
- Great documentation and community support
- Docs at: docs.mongodb.org
- Support for almost all major languages
Linux
Head to mongoDB website, in downloads section, select appropriate distribution.
Download package distribution
Or
sudo apt-get install -y mongodb-org
Configuration
MongoDB by default stores data in the /data/db parent directory. Create this directory using
mkdir -p /data/db
MongoDB must have read and write access to this directory
Command Line Interface
MongoDB comes with a built in Command Line Interface (CLI). To start the CLI type mongo into the console. The CLI will be your best friend for debugging.
Basic Commands- Show current database: db
- Show available databases: show dbs
- Switch to database: use databaseName
- Show collections: show collections
- Basic JS Syntax