MongoDB.live, free & fully virtual. June 9th - 10th. Register Now MongoDB.live, free & fully virtual. June 9th - 10th. Register Now

MongoDB Compass Update - Empty Databases

I was able, using MongoDB Compass to connect to my local database and after the update, I can’t anymore.

I am using a mongodb docker image (library/mongo:4.0.12) using the querystring mongodb://db:27017/admin to connect my app to the db. My app connects fine. The port 27017 is being exposed to the outside world from the docker image.

Before the update, I was able, using MongoDB Compass, to create a new connection using the default values (localhost and port 27017). Now, after then update, I can still create a new connection, I can see the databases but the databases have no collections! Has anything changed in the update that would cause this issue?

Thanks!

Can you connect on commandline using the mongo program, use a database and do “show collections” to see what collections are there? Compass should show what’s there…if it’s different from what you see in Compass, report back.

I found the solution!

What I have on my local machine:

  • mongo instance running on port 27017
  • docker image (mongodb) running which was exposing the mondodb instance on the same port 27017.

By changing the port that the docker image was exposing the mongodb instance to, for example, 28000, and then using Compass to connect to it, it worked fine.

I really don’t know how it was working previously (before the update). Maybe the docker’s instance was overriding the local mongodb instance and then after the update, that was reversed.

Everything works fine now!

Thanks!