I installed MongoDB community Server from this link. But when I look into C:\Program Files\MongoDB\Server\6.0\bin , I am not able to locate mongo.exe file. I am able to see mongod.exe and mongos.exe. Can someone help. Thank you.
legacy mongo shell (mongo
) no longer ships with server binaries (for servers >= 6.0). You can download a new shell version (mongosh
) from here
mongo
Shell Removed" –
Domingadomingo Answer from dododo worked for me.
- Download Mongo Shell - mongosh from MongoDB Download Center
- Extract the contents of the bin from the downloaded zip file to the bin file of your MongoDB folder and run mongosh instead of mongo.
After version 6.0.0 mongo.exe does not get installed to your bin folder so you have to manually install the new MongoDB shell which is called mongosh then you have to add its path to your system variables and then run mongosh --version to see if it got installed. Afterwards if you want to create your own databases and preform operations run "mongosh" in your terminal to connect to a MongoDB instance running on your localhost with default port 27017.
Read the mongoDB documentation for more information:
install mongosh: https://www.mongodb.com/docs/mongodb-shell/install/
The mongosh shell vs the old mongo shell: https://www.mongodb.com/docs/mongodb-shell/
Connect to a Deployment: https://www.mongodb.com/docs/mongodb-shell/connect/
To run the Mongo Shell , Download msi package from the MongoDB Community Download - https://www.mongodb.com/try/download/community The version 6.0 do not ships with server binaries so mongo.exe file wouldn't be shown. So instead download mongo shell - https://www.mongodb.com/try/download/shell After downloading unzip the bin directory in your Original bin directory (You would also need to create a new directory in C: drive named data/db) Now open the bin directory from Mongodb folder, and run mongod.exe After that keeping Mongod.exe running in background open mongosh.exe , Your mongo Shell will be started.
It should be noted, that in MongoDB version 6.0 there are two items:
- The legacy
mongo
shell is removed from MongoDB 6.0 - The MongoDB Shell (
mongosh
) is not installed with MongoDB Server. You need to follow themongosh
installation instructions to download and installmongosh
separately. This was already announced in MongoDB version 5.0
The legacy mongo
shell does not exist anymore on MongoDB version 6.0. If you desire the old mongo.exe
, then you can install if from an earlier MongoDB version.
mongo.exe doesn't come in version 6.0+ with a community package. However, you can follow through to use Mongo with Mongosh (Mongo Shell) + you can also use mongosh with Hyper
First, download and install Mongo shell from this link.
Then extract the file and place them in program files. (Note the path)
Now you have to create an environment variable. open the "Edit the system environment variable" window. Here is the screenshot
Now click on environment variables. Screenshot
Now click on edit under System variablesScreenshot
Paste the path of the Mongo shell to set up the environment.
Now Set up Using Hyper
Run
cd ~
to go to the root directory in Hyper.Then run
touch .bash_profile
. to create the file.After that Run "
vim .bash_profile
" to open the file and press "i" to insert path.Now enter the following path "
alias mongsh="/c/Program\ Files/MongoDB/mongosh/bin/mongosh.exe
" (Make sure to replace the path with the installation path for mongosh.exe in your computer)Now run the command
mongosh
in Hyper to check the installation. Installation Successful
You can open the InstallCompass.ps1 PowerShell script to install MongoDB Compass (which includes an embedded version of mongosh, the new MongoDB Shell) or download the MongoDB Shell from the the MongoDB Download Center
You also need to add a path variable of the bin folder where mongosh application is present (after downloading from the below link:
https://www.mongodb.com/try/download/shell ).
Then you can use mongosh
command from anywhere using CMD:
Just install mongosh (mongo shell) from MongoDB site mongoDB site , after installing unzip the file and go to bin folder and copy the mogosh file and paste in the directory where your all mongo file is stored( MongoDB -> server -> 6.0 -> bin ). after this open cmd and rum mongosh command. it will successfully run.
download mongo shell from https://www.mongodb.com/try/download/shell downloading and unzip the bin directory copy the files in the original bin directory from Mongodb folder, and run mongod.exe open a new tab and run mongosh.exe which worked for me.
if you download mongoDB version<6.0 then command for mongo shell is (mongo)
if you use mongoDB version>6.0 then command for mongo shell is (mogosh)
but you must be place inside mongoDB download folder (mongosh.exe) file
https://downloads.mongodb.com/compass/mongosh-1.8.0-win32-x64.zip
and after download you must be keep extract the zip file and keep
mongosh.exe file inside mongoDB folder bin file.
You are saving below something like:
alias mongod="/c/Program\ files/MongoDB/Server/4.0/bin/mongod.exe"
alias mongo="/c/Program\ Files/MongoDB/Server/4.0/bin/mongo.exe"
But since in updated version some changes are made so you need to do some changes as well like this:
alias mongod="/c/Program\ files/MongoDB/Server/your current version(example: 5.0 or 6.0 or 6.1 etc)/bin/mongod.exe"
alias mongo="/c/Program\ Files/MongoDB/Server/your current version(example: 5.0 or 6.0 or 6.1 etc)/bin/mongos.exe"
=====> just change bold text with your old one(that is in mongo.exe's s like mongos.exe and your version only means mongo.exe to mongos.exe and your latest version what you've downloaded)
After spending an hour, I came to know that mongodb version 6+ doesn't have mongosh
and you have to install it manually.
- Go to here and download the zip file.
- Extract the zip file and then copy the folder to MongoDB server folder or somewhere else
- Copy the path and add to environment variable
- Run
mongosh
from command prompt.
STEPS TO FOLLOW AFTER DOWNLOADING SHELL FROM https://www.mongodb.com/try/download/shell
Include both your mongosh shell and mongod in environment variables.
go to your c drive and create db folder inside data folder
then run your mongosh and mongod in two different cmd windows separately
..first run mongod ..then run mongosh
if you have check-marked run as a service at the time of download then next time you are not required to start mongosh , it will automatically get started.
mongosh
(which is a client) does not start automatically when mongod
runs as service. –
Domingadomingo © 2022 - 2024 — McMap. All rights reserved.