Q: How to setup MongoDB with Terra API for data storage

EvilWolverine1 month ago

Hello. We are interested in using MongoDB (hosted on Atlas) for storing Terra payloads. We feel that it is ideal for the unstructured data in your models and the type of queries we will perform from our backend. We have tried submitting the query string in the format requested on the dashboard, yet we recieve the following error message: "Could not establish a connection, ensure terra ip addresses are whitelisted"

Which IP addresses would these be and where would we find them.

terra

Danieladmin1 month ago

Hey there,

You can whitelist Terra by going to your project dashboard on Atlas and navigating to Security > Network Access > Add IP Address and submitting the following

IP Addresses:

  • 18.133.218.210/32
  • 18.169.82.189/32
  • 18.132.162.19/32

These changes may take a few minutes to update, but then you should be able to submit the MongoDB connection details with no error!


EvilWolverine1 month ago

We have tried that but we still recieve the same error message. Here are the connection details (I have obscured parts of the string): URL => mongodb://devcluster.XXXXXXX.mongodb.net, Cluster Name => TestCluster


terra

Danieladmin1 month ago

I see, the issue could be that the scheme in the provided host url is mongodb:// and not mongodb+srv:// which would mean Terra is unable to resolve the host location as the cluster would be sharded over multiple replica instances. Could you change it and try again?


EvilWolverine1 month ago

Yes, that fixed it, thank you


terra

Danieladmin1 month ago

Awesome!