Only one positional argument is allowed

I am on the Lab: Shard a collection, and I get the error message that only one positional argument is allowed. Now, I remember reading on StackOverflow when someone had this problem, that some versions of MongoDB take the -u and -p as positional arguments, and it was recommended to type out fully --username and --password. Well, I did, but that did not solve the problem.
image

we do not see the command you entered. we cannot help you.

I think you are missing --port option

@stevej. That is because it is too long to show on one line. You can see the end of it – two versions of it, the very first line with the -p, and the other one with the --password.

As the error message indicates only one positional argument is allowed. You currently have 2; localhost:26000 and /dataset/products.json. Refer to the manual page of the command you entered. I cannot tell which command you entered because

and you did not provided the name of the command as requested.

The command I entered was in the documentation as
mongoimport

Rather than just localhost:26000 use –host=localhost:26000 as documented.

1 Like