kossnocorp / typesaurus

🦕 Type-safe TypeScript-first ODM for Firestore
https://typesaurus.com
412 stars 34 forks source link

saving `serverTimestamp()` not working as expected #90

Closed skwny closed 3 years ago

skwny commented 3 years ago

When using firebase.firestore.FieldValue.serverTimestamp(), the saved data results in:

image

I've tried saving this via set(doc, id, data) as well as db.doc(ref).set(data) using the same ref and data, and only the latter method saves in the appropriate format, ie:

image

Is there another way that the Firestore Timestamp must be generated for Typesaurus?

kossnocorp commented 3 years ago

Hey, sorry about that. You should use value('serverDate') instead of the native FieldValue.