Understanding command output

I am using one db and when I run the command

“show collections”

I get the following output…
Warning: unable to run listCollections, attempting to approximate collection names by parsing connectionStatus

Would like to know what does it mean?

Hi @ragarwal1_N_A,

Generally, it means that you haven’t given “readWriteAnyDatabase” role to the user for the “admin” database OR, It could be probably because authentication is disabled…!!

Can you clarify to me that you have created a user for the specific database.?

If not, you can create a user by using the following command:

use dbName
db.createUser({ user: "USERNAME", pwd: "PASSWORD", roles: [ "readWrite", "dbAdmin" ] })

And try to use this to connect to the MongoDB database.

Meanwhile, by using db.system.users.find().pretty() command check the authentication status of the user.

Warning: unable to run listCollections, attempting to approximate collection names by parsing connectionStatus
> show dbs
> db.system.users.find().pretty()

For more info read here.

Hope it helps!!

Kind Regards,
Kushagra

Thanks… it seems to be access issue. I have raised the access request to the specific db. I will come back if the issue is still unresolved.

Hi @ragarwal1_N_A,

Yeah, it could be due to the authorization issue as I mentioned it doesn’t have a specific role granted.

Yeah, you can reach out if you need any further assistance.

Kind Regards,
Kushagra

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.