- NoSql, Non Relational Database
- Store JSon
- Easy to get started
- Free cloud hosting--Atlas
In MongoDB, a database can be defined as a physical container for collections of data. Here, on the file system, every database has its collection of files residing. Usually, a MongoDB server contains numerous databases.
Here is a table showing the relation between the terminologies used in RDBMS and MongoDB:
RDBMS MongoDB
Database Database Table Collection Tuple or Rows Document Column Field Table Join Embedded Documents Primary Key Primary key / Default key Mysqld / Oracle mongod
-
MongoDb is a JSON(javascriptObjectNotation) Format
-
Mongodb stores doucment in BSON(Binary JSON)
JSON is support 6 data Type
- String
- Number
- Boolean
- Array
- Object
- Null
BSON is Support data type
- Strig
- Double
- 32-bit integer
- 64-,,
- Boolean
- Array
- object
- Null
- Regular Expression
- Timestamp
- Binary Data
- Date
- Objectid --> this is primery key and others
server client to the mongoDB is working
- open terminal-->mongod and the start the server
- open another terminal-->mongo type is a Client
- facebook,Google,EA,Sega,ebay
- show active database --> (db)
- List all available databae --> (show dbs)
- change Active database --> (use dbname)
- Create Database --> (use dbname new value sent to the database new created )
- Create new Collecion -->(db(dbname).createCollection("user"))
- Delete Collection -->(db.getCollection("collection name").drop())
- Delete Collection -->(db.dropDatabase())
- Help --> db.help()
- Insert -->db.collectionname.insert({name:"selva"})
- InsertOne -->insert & insertOne is same new version
- InsertMany --> db.collectionname.insertMany([{},{}])
- Find Doucment --> db.collectionname.find()
- Find One Doucment --> db.collectionname.findOne()