- Stores data in the format of json, key-value pairs.
- Fast retrieval of data.
- Download the MongoDB compass from here.
- Download the MongoDB shell from here.
- Set the bin location in the system variable path.
- Open the command prompt and run
mongosh
- To_Create_database
use database_name
- create_collections_and_add_one_record
db.collection_name.insertOne({"First name":"Dhamu", "last name": "R"})
- Create_collections_and_add_multiple_records
db.collection_name.insertMany([{"first name" : "Krish1", "last name":"Naik1"},{"first name":"Krish2","last name":"Naik2"}])
- Query_all_data
db.collection_name.find()
- Fetch_particular_data
db.collection_name.find({"first name":"Krish"})
- To install the python library run the below script in the cmd prompt
pip install pymongo
- Refer the script for
- establishing connection
- create database
- insert single data
- insert multiple data
- Refer this script for
- Querying data
- Nested documents
- Refer the script for the following functions
- update_one()
- update_many()
- replace_one()
- Refer the script for
- sum
- average
- multiply
- project