# Custom database connect to MongoDB Cloud Atlas

**URL:** <https://community.auth0.com/t/custom-database-connect-to-mongodb-cloud-atlas/12266>\
**Category:** Get Help\
**Tags:** custom-database\
**Created:** [June 12, 2018, 12:31pm UTC](https://community.auth0.com/t/custom-database-connect-to-mongodb-cloud-atlas/12266 "2018-06-12T12:31:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gopherr127](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@gopherr127](https://community.auth0.com/u/gopherr127)\
**Post date:** [June 12, 2018, 12:31pm UTC](https://community.auth0.com/t/custom-database-connect-to-mongodb-cloud-atlas/12266/1 "2018-06-12T12:31:52Z")

</div>

I was able to set up a custom database connection and manage my users by creating an Azure Cosmos DB (mongodb). I attempted to connect to a MongoDB Cloud Atlas cluster, but I had no success. I believe it has something to do with the version of the NodeJS driver used, but I’m not familiar enough to know what questions to ask or how to troubleshoot.

The MongoDB Cloud Atlas offers two example connection strings, based on the driver version being used, but neither seem to work for me.

## Using Driver 3.6 or later:

**Connection string example:**  
`mongodb+srv://myuser:userpass@clustername.mongodb.net/dbname?retryWrites=true`

**Error message received:**  
`[SandboxUnhandledError] unknown mongodb+srv://myuser:userpass@clustername.mongodb.net/dbname?retryWrites=true config`

## Using Driver 3.4 or earlier:

**Connection string example:**  
`mongodb://myuser:userpass@clustershardname.mongodb.net:27017,clustershardname.mongodb.net:27017,clustershardname.mongodb.net:27017/dbname?ssl=true&replicaSet=clustershardname&authSource=admin&retryWrites=true`

**Error message received:**  
`[Error] Error: Client request error: socket hang up`

Has anyone has success connecting their Custom Database to **_MongoDB Cloud Atlas_** cluster?

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [December 19, 2018, 2:33pm UTC](https://community.auth0.com/t/custom-database-connect-to-mongodb-cloud-atlas/12266/3 "2018-12-19T14:33:57Z")

</div>

Hey @gopherr127!

As it has been more than a few months since this topic was opened and there has been no reply or further information provided from the community as to the existence of the issue we would like to check if you are still facing the described challenge?

We are more than happy to assist in any way! If the issue is still out there please let us know so we can create a new thread for better visibility, otherwise we’ll close this one in week’s time.

Thank you!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [December 24, 2018, 5:00pm UTC](https://community.auth0.com/t/custom-database-connect-to-mongodb-cloud-atlas/12266/4 "2018-12-24T17:00:06Z")

</div>

This topic was automatically closed after 5 days. New replies are no longer allowed.
