Connecting to MongoDB

Thank you so much, one last thing:

MONGO_HOST = “asfasdf.moralis.io

what would I replace asfasdf with?

The MongoDbIP? or the link to my dashboard? or my server URL?

very much appreciated

you put there the IP that you find in your admin interface for mongo db, in same place where you find the port

If I’d like to connect via mongodb in javascript (ignoring the moralis API), what would be the username or password?

Thanks!

no username or password, you’ll have to whitelist your IP in admin interface

Can you show how the url would look like, can I just leave out username and password?

Can i whitelist a domain if I have a changing IP address?

you can not whitelist a domain, only IPs

What is the correct way for implementing server side rendering database connections under varying IP addresses in production settings?

you could use a proxy that has a static IP, or you could use Moralis SDK to make queries in db and not connecting directly to DB (you can use master key server side)

1 Like

Thanks for you fast feedback! Will give that a try :+1:

Works like a charm with the Moralis SDK. Great work!

1 Like

I feel like a 2 or 3 minute video would be very helpful for this. I’m spending hours on this and still no luck. Like where do you put the python script query? in the database api?

there is such a small amount of official documentation on this compared to some other topics. one little paragraph and a couple forum posts

The python script you can run it locally after you whitelisted your public IP. You can use any other language to connect to mongo db. Or any other tool.

ok when i try to add an ip for whitelist and hit save it doesn’t do anything

Try a logout and login again

I also keep getting an “error sycning plugins: invaled token request”

awesome! i was able to add an IP. now to figure out what the issue is now…

i type import pprint locally and get error

What error? Did you install python?

Yes I have downloaded and installed. Not sure what if I need to type any more prompts to fully install the package. it says “import” is not recognized aha