Hey how to get rid of no args for --configdb error ...i have just started learning mongodb . Can anyone help

Hi i tried to work with mongoDb today . I just installed iton my pc and tried to start a port using Hyper terminal
After that i issued the command -

but it returned
badValue: error: no args for configdb–

can anyone please tell me what this means

I am going to assume that you ran the mongos command with no parameters. mongos is the interface between clients and a sharded cluster. You can read about mongos in the documentation.

If you have installed MongoDB and have the mongod (this is the database daemon) process up and running, then you can connect to is using the mongosh command line tool.

If you have a couple of hours, I would recommend going through the M001 - MongoDB Basics course on MongoDB University. This is a free course and should help you get up to speed on using MongoDB.

1 Like

A post was split to a new topic: Windows install problem: This app can’t run on your PC

Hello there! I also run into the same problem and even followed your advice in taking the course and successfully completed it (Thank you for that!!), however, I am still very confused on how we can solve the original question. Typing mongos prints out
“badValue: error: no args for configdb–
try ‘C:\Program Files\MongoDB\Server\6.0\bin\mongos.exe --help’ for more information”
on Windows 11.
In Hyper Terminal using vim I put
alias mongos="/c/Program\ Files/MongoDB/Server/6.0/bin/mongos.exe"
but it still didn’t help me at all.
How do I get this to respond using mongosh as you said?
Thank you in advance!!!

mongos is the interface between your application and a sharded cluster. As the error states, you need to pass in the --configdb parameter with your list of config servers.

Are you instead meaning to run mognosh which is the new MongoDB shell command line interface? If so, have you downloaded the tool yet? mongosh is not included with the server install.

I have downloaded mongosh and it is working just fine, I even use it instead of the default IDE provided by the MongoDB courses when each chapter ends.
Regarding mongos, what you said raises another question about the list of config servers, because I tried the command --configdb and after that the path to the mongos.exe file.
$ mongos --configdb “C:\Program Files\MongoDB\Server\6.0\bin\mongos.exe”
This prints out:
FailedToParse: Did not consume whole string.
Am I doing something wrong?
And If so, could you explain what exactly you mean about list of config servers. I searched it a bit and still couldn’t understand.

The error comes from the fact that you are passing in an executable file and not a replicaset configuration.

I would recommend reading the mongos documentation, especially the part talking about the --configdb parameter to better understand what’s going on. If you are not trying to run a sharded cluster, then there is no need to run the mongos command.

You might want to look at taking M103 - Basic Cluster Administration as well. That course should give some overview of sharded clusters and how to use the mongos command.

1 Like

I’m new to programming, in case I can save anyone else a similar headache;

For whatever reason, the installation didn’t create a mongo.exe in the bin, meaning the “mongo” command won’t work.

Try reinstalling an earlier version (5.0 vs 6.0) and verify mongo.exe is in that C:\\Program Files\\MongoDB\\Server\\\\bin

Hi @Ryan_Chapman and welcome to the MongoDB Community forums. Sorry for my delayed response.

The mongo command line tool has been superseded by the new mongosh tool. Starting in MongoDB version 6.0 mongo is no longer being installed, but the installer should have installed mongosh.