Mongodb: by Shashank Gupta
Mongodb: by Shashank Gupta
By Shashank Gupta
Topic List
Problems with RDBMS
What is MongoDB
Comparison between SQL and MongoDB
MongoDB Overview
CRUD operation in MongoDB
Where clause commands
MongoDB ─ Data Modelling
MongoDB ─ Advantages
Where to use MongoDB?
Why MongoDB and not
MySQL?
1. Scalability
Database
Database is a physical container for collections. Each database gets its
own set of files on the file system. A single MongoDB server typically has
multiple databases.
Collection
Collection is a group of MongoDB documents. It is the equivalent of an
RDBMS table. A collection exists within a single database. Collections do
not enforce a schema. Documents within a collection can have different
fields. Typically, all documents in a collection are of similar or related
purpose.
Document
A document is a set of key-value pairs. Documents have dynamic
schema. Dynamic schema means that documents in the same collection
do not need to have the same set of fields or structure, and common
fields in a collection's documents may hold different types of data..
Collections
To create a collection
➢db.createCollection(name,options)
➢Eg:db.createCollection(‘Employees’)
Drop a collection
➢ db.collection_name.drop()
CRUD operations
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> )
Where conditions
MongoDB commands
MongoDB ─ Data Modelling
Big Data
Aadhar
Shutterfly
eBay
Content Management and Delivery
User Data Management
Mobile and Social Networking sites
Thank you