小编jqu*_*rtz的帖子

我可以向 Cloud Firestore 服务器时间戳添加天数吗?

我正在编写一个 React Native 应用程序,为具有创建日期字段以及 Firestore 中过期日期的用户创建优惠券。过期日期是创建日期加上一些天数(例如 7)

理想情况下,我想在我的 firebase 函数中使用 firestore.FieldValue.serverTimestamp() 来创建日期,并为此添加 7 天作为到期时间,以避免用户生成日期。

有办法做到这一点吗?

firebase react-native google-cloud-firestore

5
推荐指数
2
解决办法
3080
查看次数