Cloud Firestore,检索当前用户 [英] Cloud Firestore, retrieve current user
问题描述
除了正确的方法之外,我已经尝试了所有方法,以便从Cloud Firestore中的用户集合中检索currentUser(doc).
I have tried everything, well except the right way, to retrieve the currentUser(doc) from users collections in Cloud Firestore.
例如vue-firestore:
Such as vue-firestore:
this.$ binding("user",firebase.firestore().collection("users").doc(this.firebase.auth().currentUser))
this.$binding("user", firebase.firestore().collection("users").doc(this.firebase.auth().currentUser))
非常感谢您能给我的帮助.
Thanks so much for any help you can give me.
推荐答案
要从集合中获取用户,您需要已登录用户的UID.Auth()对象尚未在"Firestore数据库触发器"中实现.(已针对Firebase RTD实施)
To get the user from a collection you would need the signed in user's UID. The Auth() Object is not yet implemented in "Firestore database triggers". (It is implemented for firebase RTD)
在这里查看我的答案:
从Firebase的Cloud Functions中的Firestore触发器中获取用户ID?
这篇关于Cloud Firestore,检索当前用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!