MongoDB Atlas connection

Hi - I am trying to follow the tutorial on mongo db at :
The problem is in the example, it conencts to a local mongodb deployment and I want to connect to Mongo Atlas.

In the file the advise is to put - “url: mongodb://hostname:27017/myDatabase”

However, Atlas URL should be “mongodb+srv://hostname:27017/myDatabase”

Liquibase does not seem to like this, it throws an exception:

Cannot find database driver: Driver class was not specified and could not be determined from the url

Surely connecting to mongo atlas should be possible? Please guide me as to how?


Hi @spozza,

MongoDB support is provided by Liquibase extension, which means the additional functionality for the db platform is provided by the community (and is a good candidate for being pulled into liquibase core if it aligns).

I’ve never seen MongoDB Atlas being used, and so, I would recommend logging an issue so the maintainer can give the definitive response as to support, or add it if not present:



Thanks that helps

I did figure this out and the solution is to just use an older style url to connect it to atlas (without the srv bit) which does the job

OMG, that’s awesome @spozza,

Favor please: Would you share the format? Is it just the TLS arg in the Url?

I am so happy you got it working!


yeah sure. So the atlas connections have the “+SRV” syntax which first problem is that it confuses the driver auto detection

To resolve, I used a backward compatible connection string like this:


This successfully recognizes the driver and also makes the connection.
I checked with mongo if this format was likely to be deprecated at any stage and they said very unlikely

Maybe this will help someone else someday :slight_smile:



@spozza Above mentioned way is not working for me… It is giving me an error
Unexpected error running Liquibase: liquibase.exception.DatabaseException: Could not query for long
Could you please help where i am going wring ?

@spozza , thanks for your reply.

@Nitish , welcome!

Would you share the exact liquibase command you are running? If you are using a file, please share the info (esp. URL and classpath). Also will need to see your complete log, its not enough info to diagnose with just the error snippet.