Storing images in MongoDB

时间:2019-04-08 13:32:18

标签: mongodb cloud9 mongodb-atlas

I have set up my Mongodb database have connected successfully. However my project is to create an online cookbook. My database currently is various recipes but with each document I want an image to be linked to it.

I know I can use gridFS but I would prefer to store the images in the same place as the recipes.

I have seen I can use base64 but that is no appearing for me

I am very new to using Mongo and some advise is greatly appreciated

1 个答案:

答案 0 :(得分:0)

将图像存储在s3存储桶中,并将s3图像的路径存储在DB中。

使用s3网址,您可以访问图片。