Unit 1 Part1
Unit 1 Part1
► Insert
► db.collectionName.insert( {queryBSON} )
► Update
► db.collectionName.update( {queryBSON}, {updateBSON},
{optionBSON} )
► updateBSON
► Set field to 5: {$set: {field: 5}}
► Increment field by 1 {$inc: {field: 1}}
► optionBSON
► Options that determine whether or not to create new documents, update
more than one document, write concerns
Interacting with MongoDB
► Delete
► db.collectionName.remove( {queryBSON} )
What is Document Database
{
"Students":[
{"firstName":"Siya", "lastName":"Sharma",
"Location":"India"},
{"firstName":"Ron", "lastName":"Smith",
"Location":"USA"}, {"firstName":"Bash",
"lastName":"Tao","Location":"Philippines"}],
"Teachers":[{"firstName":"Dheeraj",
"lastName":"Sareen",
"Location":"India"}, {"firstName":"David",
"lastName":"Baker","Location":"Canada"}]
}
EXAMPLE
► Amazon Linux 2
► Debian 9 and 10
► RHEL/CentOS 6, 7, and 8
► SLES 12 and 15
► Ubuntu LTS 16.04 and 18.04
► Windows Server 2016 and 2019
SCALABLE
► Document Database
► MongoDB documents are similar to JSON objects
and these documents can contain arrays, other
documents, or an array of documents.
► Collections
► The MongoDB documents are stored in collections.
So you can consider this as a table with respect to
the relational database.
Introduction to Mongo DB Core
Concepts and Vocabulary