I have added some MongoDB commands for the Database, I will add more commands as i Learn more and more in Mongo, will even add some API which i am currently working on REST API. The List has not been update in the txt file, soon will add more new commands, till than you can work on the commands given by me.
-
Download MongoDB from this website and make sure you download the community version and not the enterprise version as shown in the image.
https://www.mongodb.com/try/download/community -
Install MongoDB as a service in your device so it will be always running in the background and you dont have to start everytime from the app.
Here the Data directory can be change as per your way, in any folder. -
Then after the install, Close MongoDB and MongoDb Compasss.
- go to the install Directory as shown mine, yours might also be same if you installed in the C drive.
- C:\Program Files\MongoDB\Server\6.0\bin
- copy this path.
- do Win+S type ENV and enter to System Environment Variables.
- tap on path and tap edit.
- in that add new path which we copied on the point ii and apply changes or OK.
-
Then open your Terminal/Windows PowerShell and type this command shown in the image.
-
if this doesn't work or shows any error, then just do this things.
- go and download this zip file.
- https://www.mongodb.com/try/download/shell
- This is the MongoDB Shell or you can called it as the Compiler for Mongo.
- Extract this Zip and in this zip go and copy this Mongosh.exe.
- Then go and paste this exe in and MongoDB directory, for mine is this C:\Program Files\MongoDB\Server\6.0\bin (here i have just renamed the Mongosh.exe file into Mongo so it will be easy to type in the Powershell).
- Add this path in the C folder where Mongo is installed C:\data\db.
- After this you can again go to the Terminal/PowerShell and type Mongo or Mongosh to start the Database.
- Open MongoDB Compass and tap on Fill in Connection Fields individually.
- After this Screen will be shown then do nothing just tap connect.
- Then Tap on Create Database.
- Name your Database according to you and add a collection name to it whatever you want, do tick any options just fill this 2 cells and tap Create Database.
- This type of a Screen will be shown after the creation of database.
- You can tap on the Database and Check Collection.
- Now Everything is set, Start Entering your data in your own database From the PowerShell.
you can also reffer to this links for understanding the commands
also remember this things given in the image