Skip to content

It contains tutorials for the DB's like MySQL, SQLAlchamy, MongoDB and Firebase

Notifications You must be signed in to change notification settings

Dhamu785/DataBase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 

Repository files navigation

MongoDB

MongoDB installation and Mangosh PowerShell

Overview

  • Stores data in the format of json, key-value pairs.
  • Fast retrieval of data.

Download and setups

  • Download the MongoDB compass from here.
  • Download the MongoDB shell from here.
    • Set the bin location in the system variable path.

Create database and collections in mongosh

  • 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"})

MongoDB with python

  • 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

About

It contains tutorials for the DB's like MySQL, SQLAlchamy, MongoDB and Firebase

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages