Saving timestamp to firestore
See original GitHub issueHey that a really good library, helped me a lot. Thanks!
I’m trying to create a document with a timestamp in it and I’m keep getting an empty map on Firestore.
firestore.createDocument(USER_EXPIRATION_COLLECTION, { userId: userId, classId: classId, timestamp: new Date()});
and the output:
{ name: 'projects/.../usersClassesExpiration/...', fields: { userId: 'userId', timestamp: {}, classId: 'classId' }, createTime: Tue May 26 2020 11:11:09 GMT+0300 (Israel Daylight Time), updateTime: Tue May 26 2020 11:11:09 GMT+0300 (Israel Daylight Time) }
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7
Top Results From Across the Web
How to save a timestamp in firestore - Stack Overflow
I would suggest converting it to epoch time as int store it in your cloud and re-convert to DateTime after fetching it. Example:...
Read more >Firebase.Firestore.Timestamp Struct Reference - Google
Timestamp. bookmark_border. Stay organized with collections Save and categorize content based on your preferences. Dismiss
Read more >Firestore: Storing Date as timestamp · Issue #1292 - GitHub
Saving objects with Date turns the date into string fields. Is it possible to save as timestamp fields?
Read more >Saving Date in firestore : r/Firebase - Reddit
A better solution is to use the library's firebase.firestore.FieldValue.serverTimestamp() method to let Firebase take care of it, and when you ...
Read more >Update a Firestore document Timestamp - Google Cloud
Was this helpful? Update a Firestore document Timestamp. bookmark_border. Stay organized with collections Save and categorize content based on your ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Verified that
instanceoffails forDateobjects outside of the library.https://github.com/grahamearley/FirestoreGoogleAppsScript/blob/13365c9156c752d52d10f82a3250cf7865d5434f/Document.ts#L140
This line will be updated to include additional checks. Thanks for bringing this up!
Bit of ugyl fix: