We have seen customers trip up over a very subtle problem with the expansion from the mongodb+srv URL to the cluster URLs.

If your mongodb+srv URL is yourhost-abcd123.mongodb.net with hyphen (-) between yourhost and abcd123. That
 means when you do the URL expansion for the tunnels, you need to use the hyphen as well.

So that would mean your tunnels need to be setup as:

yourhost-shard-00-01-abcd123.mongodb.net:27017
yourhost-shard-00-00-abcd123.mongodb.net:27017
yourhost-shard-00-02-abcd123.mongodb.net:27017

Note the hyphens instead of the periods before abcd123.

The same is true if you use a “.” in the mongodb+srv URL, for example yourhost.abcd123.mongodb.net

yourhost-shard-00-01.abcd123.mongodb.net:27017
yourhost-shard-00-00.abcd123.mongodb.net:27017
yourhost-shard-00-02.abcd123.mongodb.net:27017

Hopefully this helps avoid this slight pitfall and gets you up and running.


If you have questions, or if this solution doesn’t work or fit your use case, please reach out to us at Support so we can help figure it out with you.


Working with sensitive data, like HIPAA, Financial, or Personally Identifiable Information (PII)? 
    Then you will want to check out our QuotaGuard Shield solution, it's the same as QuotaGuard Static, but with stronger end to end security for your requests. We can also help migrate current Static customers to Shield for free, just reach out to us at Support to request assistance.