Thursday 28 December 2017

1. Download MongoDB from here
2. Install the MongoDB using "Custom" and set the path to C:\MongoDB
3. After install is completed, open "Command Prompt" as "Administrator"
4. Issue the following command to create folder for databases and logs
    C:\MongoDB>md log
    C:\MongoDB>md data\db
5. Navigate to C:\MongoDB\Bin and run the following command
    mongod --directoryperdb --dbpath C:\MongoDB\data\db --logpath C:\MongoDB\log\mongo.log --logappend --rest --install
6. Run the service:
  C:\MongoDB\Bin>net start MongoDB
7. Type "mongo.exe" to open the shell
8. Useful commands:
cls : clear screen
show dbs : show the list of databases
use customers : create database 'customers' and switch to it
db : give the current database name
9. Assign role to database
db.createUser ({
user: "admin",
pwd: "admin",
roles: ["readWrite","dbAdmin"]
    });


MongoDB manual and reference: click here
MongoDB Download centre: click here


No comments:

Upgrade Windows 11 Home to Windows 11 Pro

Disable internet connection (Wi-Fi, Internet, etc.) Change the product key using the following Generic product key:                     VK7J...