I installed MongoDB community Server from this link. But when I look into C:Program FilesMongoDBServer6.0bin
, I am not able to locate mongo.exe file. I am able to see mongod.exe and mongos.exe.
Can someone help. Thank you.
I installed MongoDB community Server from this link. But when I look into C:Program FilesMongoDBServer6.0bin
, I am not able to locate mongo.exe file. I am able to see mongod.exe and mongos.exe.
Can someone help. Thank you.
13
Answers
legacy mongo shell (
mongo
) no longer ships with server binaries (for servers >= 6.0). You can download a new shell version (mongosh
) from hereAnswer from dododo worked for me.
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.
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/
It should be noted, that in MongoDB version 6.0 there are two items:
mongo
shell is removed from MongoDB 6.0mongosh
) 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.0The legacy
mongo
shell does not exist anymore on MongoDB version 6.0. If you desire the oldmongo.exe
, then you can install if from an earlier MongoDB version.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.
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: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
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.
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.
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 thepath with the installation path for mongosh.exe in your computer)
Now run the command
mongosh
in Hyper to check the installation. Installation SuccessfulYou 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)