[英]How to insert image to mongodb via SimpleSchema
How can I define a SimpleSchema template to store image data/binary data inside a mongodb storage. 如何定义SimpleSchema模板以在mongodb存储中存储图像数据/二进制数据。
What is the type I should use? 我应该使用哪种类型? Should I use Object type? 我应该使用对象类型吗?
It's not always a good idea to store images or other files in MongoDB
database(or any other database). 在MongoDB
数据库(或任何其他数据库)中存储图像或其他文件并不总是一个好主意。 Rather store them in a separate Storage server like AWS S3
or Azure blob storage
or whatever storage server and keep the link to the file in your MongoDB
database. 而是将它们存储在单独的存储服务器(例如AWS S3
或Azure blob storage
或任何存储服务器中,并将指向文件的链接保留在MongoDB
数据库中。 It will help you keep the DB server lean. 这将帮助您保持数据库服务器的精益。
For more details study on multi-tier application architecture
. 有关更多详细信息,请研究multi-tier application architecture
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.