Warning: unable to run listcollections

Hello, I am getting the error <warning: unable to run listcollections> when trying to get the collections even after use . show databases work also.

I think it is ‘show collections’, rather than ‘listcollections’.

@steevej-1495 , yes, I used “show collections”, but “unable to run listcollections” is the error.

I have also tried

show tables and db.getCollectionNames()

get the same error

To which mongod are you connected?

It is probably an authentication/authorization issue. If you connect to the atlas server of the course we only have access to the aggregations database. Try selecting that database first.

@steevej-1495 Yes, I can switch databases without any problems but can not read the collections.

A video with the connection and the error

https://screencast-o-matic.com/watch/cqVIDw3XAy

We (all of us when authentication with user m121) simply do not have access to the video database.

It should work with the database aggregations that we use for this course.

@steevej-1495 ouch, understood, I think I made a mental connection between the video database and the video collection. I apologize for the confusion.

No problem. Have fun.

It happened to me too :smiley: Thanks

Solution:

use aggregations
show collections