I finished installing MongoDB and I am trying the command $ mongo
and I keep getting an error:
BadValue: error: no args for --configdb try 'C:Program FilesMongoDBServer6.0binmongos.exe --help' for more information
I finished installing MongoDB and I am trying the command $ mongo
and I keep getting an error:
BadValue: error: no args for --configdb try 'C:Program FilesMongoDBServer6.0binmongos.exe --help' for more information
2
Answers
I think you might have set up the config server as a standalone process and you might have to use a replicaset instead.
This might help:
https://www.mongodb.com/docs/manual/sharding/
Your command will look something like this:
mongos –configdb replsetname/localhost:27010 –port 27011
But if you are trying to use the mongoDb shell then you might have to download it separately. They do not bundle the shell together as they used to before. So you have to download mongosh as a zip and extract the contents of the "bin" folder to the "bin" folder where you have installed mongo. Then you can use the MongoDB shell(mongosh.exe).
You need to install mongos shell separately. It can be downloaded as a zip file you need to extract it to the program files. Then add the location of mongos.exe to the vim.
If you face any difficulty in adding the path to vim use this link.
Make sure to change the version in the path example, mine will look like this.
Don’t make an exact copy of this. Change the path according to your setup and add these values in vim and close it using
Use the provided link for handling the vim.