Connect to MongoDB Atlas from a worker

I have a database on https://www.mongodb.com/cloud/atlas (a cloud-provided database). I wish to connect to this database from my Cloudfare worker.

I read on this StackOverflow that I cannot connect to mongo:// endpoints from a Cloudfare worker, but only HTTP endpoints.

Is there a workaround for this? Is connecting to mongodb databases planned in the roadmap?

Thanks.

I am afraid, no. Cloudflare only proxies HTTP.

I haven’t try it, as I don’t a MongoDB instance at the moment ready to test.

Argo Tunnel could do the job as mongo is available on http://localhost:28017

https://developers.cloudflare.com/argo-tunnel/trycloudflare/

cloudflared tunnel --url http://localhost:28017