© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Cloudflare DevelopersCD
Cloudflare Developers•6mo ago•
6 replies
bunz

MongoDB errors

I wanted to update my worker removing the old deprecated MongoDB Atlas API, and I read that now Workers should support the MongoDB node.js driver, but I can't seam to make it work.

Everything is working fine on my local machine, I set the compatibility flags to
nodejs_compat
nodejs_compat
and compatibility date to
2025-05-05
2025-05-05
, but when I publish the worker I keep getting errors like:

- MongoDB operation error: MongoServerSelectionError: [unenv] net.createConnection is not implemented yet!

- MongoDB operation error: Error: [unenv] dns.resolveSrv is not implemented yet!
- MongoDB operation error: MongoServerSelectionError: [unenv] net.createConnection is not implemented yet!

- MongoDB operation error: Error: [unenv] dns.resolveSrv is not implemented yet!


In my package.json the versions of wrangler and mongodb are respectively
^4.28.1
^4.28.1
and
^6.18.0
^6.18.0


Looking at this blog post https://alexbevi.com/blog/2025/03/25/cloudflare-workers-and-mongodb/ I cannot seam to find what I did wrong.

Is this relative to the Free workers plan I'm using?

A little bit of insight would be useful, thanks to who can help!
ALEX BEVILACQUA
Cloudflare Workers and MongoDB
Previously I wrote about Why Cloudflare Workers Don’t Work With MongoDB, but since then the Cloudflare team has done some great work to add support for the missing Node.js features MongoDB’s driver required to operate successfully from Cloudflare Workers:
Cloudflare Workers and MongoDB
Cloudflare Developers banner
Cloudflare DevelopersJoin
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Next.js + MongoDB errors with worker
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
3d ago
mongodb
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
16mo ago
MongoDB simple question
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
15mo ago
Mongodb connect err
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
3y ago