Reputation: 311
I need to add images to my mongoDB using Node and Express. I am able to normal data in it by running the mongo shell. But I cannot find any method to add images to it. Can anybody help?
Upvotes: 4
Views: 1737
Reputation: 33824
Please don't do this. Databases are not particularly well suited to storing large bits of data like images, files, etc.
Instead: you should store your images in a dedicated static file store like Amazon S3, then store a LINK to that image in your MongoDB record.
This is a lot better in terms of general performance and function because:
Overall: it is a much better / safer / faster strategy.
Upvotes: 6