I need to add a server side timestamp on new documents added to Firestore using a Flutter app. I see I am supposed to use FieldValue.serverTimestamp
but I am not sure where to find this.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
As of September 5th, the updated cloud_firestore
v0.8.0 library now has FieldValue.serverTimestamp()
. All is now well in the universe
回答2:
'timestamp' : Timestamp.now()
Timestamp.now() is part of cloud_firestore;