# You can easily install mongodb to run locally on your windows machine using chocolatey
# run
$ choco install mongodb
# to properly set up, add the mongodb path -- in my case it is; C:Program FilesMongoDBServer5.3in -
# to your system environment variables
# then test your installation
$ mongo --version
# expected output
# MongoDB shell version vx.y.z
# Build Info: {
# "version": "x.y.z",
# "gitVersion": "ea201bb0ab5fa4c9c9d27c29a538987db15c0a36",
# "modules": [],
# "allocator": "tcmalloc",
# "environment": {
# "distmod": "windows",
# "distarch": "x86_64",
# "target_arch": "x86_64"
# }
#}
npm i mongoose
## Short Method: Use Chocolatey (A package manager for Windows)
## After Installing Choco (https://chocolatey.org/install)
choco.exe install mongodb-shell -y
## Long Method: Download Installer
# Download Installer here: https://www.mongodb.com/try/download/shell
# Select Your OS & MongoDB version, Click Download
# Run the downloaded installer & follow the wizard through installation
## Using MongoDB Shell
# Connect to a LOCAL MongoDB Instance:
mongosh "mongodb://localhost:27017"
# Specify Database Name
mongosh "mongodb://localhost:27017/hevodb"
# Custom Port
mongosh —-port 28089
# Connect to a REMOTE MongoDB Instance
mongosh –host mongodb0.example.com –port 28015
Best platform
openssl rand -base64 756 > /opt/mongo-keyfile chmod 400 /opt/mongo-keyfile chown mongodb:mongodb /opt/mongo-keyfile