![](/img/trans.png)
[英]Firebase firestore not creating doc with recently created uid
[英]Creating a UID as a field in Firestore
是的,很有可能
val id uuid = UUID.random()
val city = hashMapOf(
"UID" to uuid
"name" to "Los Angeles",
"state" to "CA",
"country" to "USA"
)
db.collection("cities").document(uuid)
.set(city)
.addOnSuccessListener { Log.d(TAG, "DocumentSnapshot successfully written!") }
.addOnFailureListener { e -> Log.w(TAG, "Error writing document", e) }
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.