Is it safe to store small images in Firestore?

ⅰ亾dé卋堺 提交于 2021-02-08 04:21:38

问题


I have a Firebase database and now I'm moving to Firestore. Are there any problems if I store small images in Firestore that are encoded to Base64? I have a collection sport_products where I have documents with all details and I also have an icon with the corresponding brand and I want to store all data + icon in a single place. Is it safe?


回答1:


You don't need to base64 encode anything in Firestore. It has a native binary field type called "bytes". base64 will just make the data larger for no reason (unless you really only intend to consume that data in base64 format).

You have a maximum document size of 1MB, so as long as you never go over that limit for all the data in that document combined, you won't have a problem.



来源:https://stackoverflow.com/questions/53538112/is-it-safe-to-store-small-images-in-firestore

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!