How to access firestore.Timestamp from Firebase Cloud Function

后端 未结 5 1795
遥遥无期
遥遥无期 2021-02-12 17:46

We are in the middle of converting our Firestore Date object to the new Timestamp Objects

We have done so successfully on the front end by importing firestore



        
5条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-12 18:30

    With the release of V2.0 of Firebase Functions is looks like they've added Timestamp support in the Firebase Admin SDK package.

    Have a look at the official docs here.

    import { firestore } from 'firebase-admin';
    ...
    const now = firestore.Timestamp.now()
    

提交回复
热议问题