Show collections doesn't show anything in the class read-only cluster

The show collections option doesn’t show anything in any of the read-only learning database that is being used in the MongoDB University Courses.

See the screenshot.

image

I think I got that. The connection is made in the wrong database (movies, instead of video).

Question to MongoDB support/experts. **When the database doesn’t exists (just like above, movies database doesn’t exists), shouldn’t MongoDB shell thrown an error on that? **

Databases and collections are automatically created.

1 Like

Hi @prasthak,

In your case, the incorrect database name is not actually creating the database. It’s just filling the shell variable db with the value that you specified.

You can verify this by running this command : show dbs.

Hope it helps!

Thanks,
Shubham Ranjan
Curriculum Services Engineer

Thanks for highlighting this subtle difference.

1 Like