问题
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