Back

MongoDB support in AppWrite

  • 0
  • Databases
Punit Diwan
6 Oct, 2023, 14:20

<#636852860709240842> I have come to know that the Mongo DB Adapter is stable as per Utopia/Database repo.

I want to try to configure Appwrite with Mongo DB using Mongo Adapter. Please tell me how can I do, I have a Mongo DB 5.0 Container Running. which Env Vars has to be added in .env file?

If the support is in beta, request you to share the details as I am testing on non-production system. I also want to know, will MongoDB Adapter support Mongo Replica Sets?

Waiting to hear from you.

Regards, Punit

TL;DR
The user wants to configure Appwrite with MongoDB using the Mongo Adapter. They want to know which environment variables to add to the .env file and if MongoDB adapter supports Mongo Replica Sets. Currently, there is no straightforward way to implement it, but it may be possible by doing a fork with some modifications. It is mentioned that the MongoDB adapter is stable according to the Utopia/Database repo. There is no solution provided in the thread.
D5
6 Oct, 2023, 14:53

Hello. Currently there's not a straightforward way to implement it, however since MongoDB is supported by utopia I suppose that it could be achieved by doing a fork with some modifications

D5
6 Oct, 2023, 14:57

As you can see in utopia: https://github.com/utopia-php/database you will need to modify those 2 files: https://github.com/appwrite/appwrite/blob/030f9629a69f7db0f3da3e76d1805383bb3a3acd/app/init.php#L66 https://github.com/appwrite/appwrite/blob/030f9629a69f7db0f3da3e76d1805383bb3a3acd/app/controllers/api/databases.php#L20

In order to connect Appwrite to a MongoDB database. As you could have supposed, that will be beta and probably will crash πŸ˜…

Punit Diwan
6 Oct, 2023, 14:58

Ok . Thanks for your reply. I will have a look into these two file and update.

D5
6 Oct, 2023, 15:07

Tell me how everything goes. I'm very curious πŸ‘€

Punit Diwan
6 Oct, 2023, 15:24

Sure

D5
6 Oct, 2023, 15:31

Forgot to mention, the host, etc needs to be changed too like in the utopia example (1st link) in this section: https://github.com/appwrite/appwrite/blob/030f9629a69f7db0f3da3e76d1805383bb3a3acd/app/init.php#L697

Not sure if it's needed to be changed too in any other places

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more