Basically, I need to know what takes less storage space and traffic - 1/0, "1"/"0" or true/false?
Thanks!
Most efficient way to store a boolean is to set the value as a boolean. That's why Firebase creators offered us this possibility. Storing the value as a boolean offers everything that Java Boolean Class offers. It's not a good practice, to use 0
or 1
in stead of a boolean.
Regarding space, yes it's a difference. Try create to 1000 records with true
and false
, then create other 1000 record with 0
and 1
, export the JSON file and you see the difference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With