Auth0 Home Blog Docs

Custom database connect to MongoDB Cloud Atlas



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:

Error message received:
[SandboxUnhandledError] unknown mongodb+srv:// config

Using Driver 3.4 or earlier:

Connection string example:

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

Has anyone has success connecting their Custom Database to MongoDB Cloud Atlas cluster?