【发布时间】:2018-08-13 08:03:22
【问题描述】:
目前,我在 Firestore 仪表板中有一个空数组。我正在尝试向其中添加一些项目。我关注了this,但没有结果。我不想痛并重写这个元素。
我的 gradle 包含:
implementation 'com.google.firebase:firebase-firestore:17.0.4'
和我的代码:
import com.google.firebase.firestore.FieldValue
...
val documentReference = firestore.collection("events")
.document(event.firebaseUserUid + "-" + event.title)
documentReference
.update("participants", (FieldValue.arrayUnion(FirebaseAuth.getInstance().currentUser!!.uid)) )
但是 FieldValue.arrayUnion 不存在。
【问题讨论】:
标签: kotlin google-cloud-firestore