Table of Contents
About MongoDB
MongoDB is a popular open-source, NoSQL database, document-oriented management system. It stores data in documents, which are essentially JSON-like objects.
Key Features
- MongoDB doesn’t require a predefined schema.
- MongoDB supports horizontal scaling, making it suitable for handling large amounts of data and high traffic loads.
- MongoDB offers a powerful aggregation framework for performing complex data manipulations and analytics.
Differences in Terminology
MySQL | MongoDB |
---|---|
Table | Collection |
Row | Document |
Column | Field |
Join | Embedded Document |
Useful Command in MongoDB Shell
//to see database show dbs // create database and set current db use studentDB // to create collection db.createCollection("studentS") // to show collections show collections // to delete current database db.dropDatabase() // to insert one document db.users.insertOne({name:"Nazim",age:31,languages:["Bangla","hindi"]}) // to see document db.users.find().pretty() // to find specific data db.users.find({name:"Nazim"}