ServerTimestamp is always null on Firebase Firestore

前端 未结 4 2056
攒了一身酷
攒了一身酷 2020-11-22 07:58

I am trying to add a timestamp field in an Android client with Firebase Firestore.

According to the documentation:

Annotation used to mark a D

4条回答
  •  日久生厌
    2020-11-22 08:56

    use FieldValue.serverTimestamp() get server timestamp

    Map msg = new HashMap<>();
    msg.put("timestamp", FieldValue.serverTimestamp());
    

提交回复
热议问题