Can Media Library Assets be stored in MongoDB?

System Information
  • Strapi Version: v3.6.8
  • Operating System: StrApi Docker Image
  • Database: MongoDB
  • Node Version: v14.16.0
  • NPM Version: 6.14.11
  • Yarn Version: 1.22.5

I would like to use StrApi purely for its Media Library feature. And I would like to store my assets in MongoDB.

I uploaded a sample image/asset, and I can see the meta data in the upload_file collection in MongoDB; however, the actual image (and its size variant) are still stored in the filesystem.

Would you kindly guide me to what I did wrong? Is there an additional setting to force all images to be stored in MongoDB?

My docker image has a non-persistent filesystem.

No, at this time (or in the near future) we don’t plan to add a provider to store binary assets in the database itself and we are planning to drop MongoDB Support in our upcoming v4: NOTICE: Dropping MongoDB Support in Strapi v4 · Issue #10186 · strapi/strapi · GitHub

1 Like

Sure, you can