在Firestore中存储小图像是否安全? [英] Is it safe to store small images in Firestore?

查看:51
本文介绍了在Firestore中存储小图像是否安全?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Firebase数据库,现在我要移到Firestore.如果我在Firestore中存储编码为Base64的小图像,是否会有任何问题?我有一个 sport_products 集合,其中包含所有详细信息的文档,还有一个带有相应品牌的图标,并且我想将所有数据+图标存储在一个位置.安全吗?

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?

推荐答案

您无需在Firestore中对base64进行编码.它具有本机二进制字段类型,称为"字节".base64只会无缘无故地使数据变大(除非您确实只打算使用base64格式使用该数据).

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).

您有一个最大文档大小为1MB ,只要您永远不要超过该文档中所有数据的总和,就不会有问题.

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.

这篇关于在Firestore中存储小图像是否安全?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆