willhlaw / node-firestore-backup-restore

Google Firebase Firestore backup and restore tool
91 stars 24 forks source link

passes timestampsInSnapshots to Firestore.settings() to prevent warning #54

Open kitfit-dave opened 5 years ago

kitfit-dave commented 5 years ago

Fixes willhlaw/node-firestore-backup-restore/issues/38

kitfit-dave commented 5 years ago

Oh yeah, so, would have to actually support the Timestamp type as well (if there are any in the firestore that you want to backup and restore)

wata commented 5 years ago

This PR solves a bug where the timestamp type will always be the current date.

kitfit-dave commented 5 years ago

Does it? Woohoo. :).

I don’t think Timestamp type is properly supported yet anyway, it doesn’t not get detected like other types (or the old date type), and is just treated like an object. It gets backed up, but I’ve not checked what it restores as (I don’t use any timestamps in any collections worth backing up).

wata commented 5 years ago

Thank you for your reply.

Yes, it is a bug that occurs when restore.

This creationDate will change to the current date on firestore.

backup.json

{
  "creationDate": {
    "type": "timestamp",
    "value": "2018-11-22T02:42:13.058Z"
  },
  "id": {
    "type": "string",
    "value": "Yy4vNitGnrCRJR849EWW"
  },
  ...