How to connect to a mongo atlas source via JDBC driver

So I have setup a free Mongo Atlas cluster by following the steps in this tutorial https://docs.atlas.mongodb.com/getting-started/

Now I understand how to get the JAVA connection details, but the format I need them to be in is jdbc:mongo://:27017 and not jdbc:mongodb+srv://TestUser:@cluster0.xnuxw.mongodb.net:/myFirstDatabase?retryWrites=true&w=majority

Any idea how I can obtain this from Mongo Atlas?

Upvotes: 1

Views: 1343

Answers (1)

Itay Cohen Tevel
Itay Cohen Tevel

Reputation: 1

MongoDB Atlas will by default allow you a MongoDB connection. If you seek a JDBC connection this is possible by enabling the BI Connector (see the cluster settings), once enabled when you go to 'connect' you'll see a new option to get this JDBC connection string. https://docs.atlas.mongodb.com/cluster-config/enable-bic/

Upvotes: 0

Related Questions