Cloud Firestore,检索当前用户 [英] Cloud Firestore, retrieve current user

查看:38
本文介绍了Cloud Firestore,检索当前用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除了正确的方法之外,我已经尝试了所有方法,以便从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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆