unstorage icon indicating copy to clipboard operation
unstorage copied to clipboard

Support MongoDB on Edge Runtime

Open nathanclevenger opened this issue 1 year ago • 3 comments

Describe the feature

Currently MongoDB support is provided by the NodeJS driver and is not supported on edge runtimes. I would propose adding additional support for MongoDB through either the Atlas Data API and/or Realm Web SDK which will run on edge runtimes like Cloudflare Workers and the Vercel Edge Runtime.

If this is an acceptable proposal, I would be willing to contribute a PR. Thanks.

Additional information

  • [X] Would you be willing to help implement this feature?

nathanclevenger avatar Jul 15 '23 14:07 nathanclevenger

Hi. Sure a new driver for mongodbAtlasData would be nice 👍🏼 (found docs here https://www.mongodb.com/docs/atlas/api/data-api/)

pi0 avatar Jul 15 '23 15:07 pi0

There's 3 ways we can implement :

  • Data API
  • Web SDK https://www.mongodb.com/docs/realm/web/mongodb/#create-documents
  • GraphQL API : https://www.mongodb.com/docs/atlas/app-services/graphql/

For reference, difference between Realm and atlas https://www.mongodb.com/community/forums/t/frequently-asked-questions-atlas-app-services-realm/167589

Hebilicious avatar Jul 16 '23 06:07 Hebilicious

Since for KV usage, we need simple operations, i prefer to use Data API with native fetch if possible :)

pi0 avatar Jul 17 '23 09:07 pi0