Reputation: 109
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?
Upvotes: 4
Views: 3172
Reputation: 317760
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.
Upvotes: 9