【问题标题】:android firebase Server Timestamp in CollectionReferenceCollectionReference中的android firebase服务器时间戳
【发布时间】:2019-03-09 06:14:27
【问题描述】:

在 Android 应用程序中,我有以下内容:

notebookRef = FirebaseFirestore.getInstance().collection("Registros");
notebookRef.add(new Lista(title, description, geoPoint, null));
Map<String, Object> value = new HashMap<>();
value.put("timestamp", ServerValue.TIMESTAMP);
notebookRef.add(value);

它发疯了,因为它没有生成时间戳,而是在 firebase 中写入以下内容:

服务器应生成自己的时间戳:see herehere

我做错了什么?

【问题讨论】:

标签: android firebase google-cloud-firestore


【解决方案1】:

您错误地使用实时数据库中的 ServerValue.TIMESTAMP 而不是 Firestore 中的 FieldValue.serverTimestamp()

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-05-03
    • 2021-11-10
    • 1970-01-01
    • 2020-10-24
    • 2021-11-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多