Strapi + MongoDB

Dear Community,
We have been evaluating your product as we are looking for some CMS headless API solution.
However we have been hitting some problems.
Everything seems to work if we choose MySQL as the database.
When we choose MongoDB, error messages pop up when we create collections and add some fields. Then the admin dashboard spins forever. The Developer Tools window inspection is giving us Failed to load resource: net::ERR_CONNECTION_REFUSED and TypeError: Failed to fetch.
Our MongoDB version is: 3.4.24, Node 12.14.0.
MongoDB is our preferred database.
Could you advice us about the compatibility of your solution with MongoDB and the possible reasons for the error messages?
Many thanks,

System Information
  • Strapi Version: 3.1.0 aplha.5
  • Operating System: Windows 10 64 bit Enterprise
  • Database: MongoDB 3.4.24
  • Node Version: 12.14.0
  • NPM Version: 6.13.4
  • Yarn Version: N/A

In which version of strapi? If in version 4, then mongodb is no longer supported.

Hi BmAdiel

I am aware of the MongoDB support being dropped on Strapi version 4.

  • Strapi Version: 3.1.0 aplha.5 is my current version.

MongoDB database is very important to us.

Is there any way to use Mongoose or something to carry on the use of MongoDB on the version 4 of Strapi?

1 Like

No unless someone builds their own database connector and talks to us for help integrating it (we would need to see some effort behind the building of the connector before we would consider helping integrate it.)

The MongoDB team were supposed to be doing what I just mentioned but they seem to have abandoned the idea. So my suggestion is: switch away from MongoDB if you want to continue using Strapi.

Thanks for your reply. We have been thinking to use an alternative database.

Hi @DMehaffy - I was using strapi v3 from quite some time with mongo in my project. With the v4, I am migrating the db to postgres. Do you have any data migration guide so I can safely move data from mongo to postgres?

1 Like

I don’t currently, with the way relations are structured a DB to DB migration (conversion of dump types) would be practically impossible. The best method I could think of would be to rebuild the Strapi app on PG (even using v4) then write some script (Node, Python, whatever) that could read from your v3 Mongo Project via REST and POST those records to the v4 Project via REST.

This type of script would almost always need to be hand crafted for your specific models so generalizing it would be pretty difficult I think.