What will be smaller to keep in Firestore and send to the client?
Array with a thousand items:
[
{date: firestore.Timestamp.fromDate(new Date(Date.UTC(2020,2,25))), value: 1.1},
{date: firestore.Timestamp.fromDate(new Date(Date.UTC(2020,2,26))), value: 1.2},
{date: firestore.Timestamp.fromDate(new Date(Date.UTC(2020,2,27))), value: 1.3},
{date: firestore.Timestamp.fromDate(new Date(Date.UTC(2020,2,28))), value: 1.4},
// AND SO ON
]
VS
[
{date: "2020-03-25", value: 1.1},
{date: "2020-03-25", value: 1.2},
{date: "2020-03-25", value: 1.3},
{date: "2020-03-25", value: 1.4},
// AND SO ON
]
QUESTION
My question is: is a firestore Timestamp larger/smaller than a text string "yyyy-mm-dd"
? Should I prefer one over the other?
NOTE: This will be sent to the client. That's why I'm looking to the smaller file size option.
UPDATE:
From: https://firebase.google.com/docs/firestore/storage-size
Does that mean a timestamp
field takes 8 bytes (from the Date and time
row on the table)?
And the "yyyy-mm-dd" would take 11 bytes? 10 encoded chars + 1?