下面的代码生成一个带有唯一文档路径的文档.如何获得这个唯一的文档路径?
db.collection("Jobs").document().set(job);
这是用于获取由.add()函数创建的文档ID的#kotlin代码
FirebaseFirestore.getInstance()
.collection(collectionReferencePath)
.get().addOnSuccessListener { querySnapshots ->
querySnapshots.documents.forEach { documentSnapshot ->
val idUnique = documentSnapshot.id //This is the Unique Id
}
}.addOnFailureListener {
it.printStackTrace()
}