0

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

rusne
  • 161
  • 1
  • 2
  • 5
  • Aren't you better off storing the images on a file server, and storing the path to the image in the DB ? – TanguyB Apr 08 '19 at 13:36
  • If you are using NodeJS I could recommend you to use Cloudinary(https://cloudinary.com) to store your images, you can't store images in MongoDB, you can store their base64 but that would be too much for the DB. Or you can save them locally and save only the path to them in the DB. – Nicolae Maties Apr 08 '19 at 13:36
  • What is maximum image size? – Mani Apr 08 '19 at 18:34

1 Answers1

0

Store the images in s3 bucket and storing the path of the s3 image in the DB.

Using s3 url you can access the image.