从登录用户创建的Firebase中读取数据-Flutter [英] Read data from Firebase created by loggedin user - Flutter

查看:69
本文介绍了从登录用户创建的Firebase中读取数据-Flutter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网上看到了很多有关如何向Firebase写入和读取数据的示例.但是,我想知道如何从仅由登录用户创建的Firebase中读写数据.

I've seen a lot of examples online on how to write and read data to Firebase. However, I want to know how to write and read data from Firebase only created by logged in User.

我们如何将此类数据绑定到用户?

How do we bind such data to a user?

谢谢

推荐答案

这可能取决于数据的整理方式.仔细阅读以下内容: https://firebase.google.com/docs/firestore/manage-数据/结构数据

It might depend on how your data are oranized. Read through this: https://firebase.google.com/docs/firestore/manage-data/structure-data

一个简单的例子:

// snippet for pulling from data once it is there
await FirebaseFirestore.instance
  .collection("USERDATA")
  .doc(userID)
  .collection('DOCUMENTS')
  .get()

// one way you might supply the function that puts data up to firestore.
uploadToCloudStorage(
      userID: user.fAuthUser.uid, fileToUpload: File(filePath));

这篇关于从登录用户创建的Firebase中读取数据-Flutter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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