firebase - 如何做一个飞镖颤动的火力基地查询连接
问题描述
我有一个用户的 firestore 表,以及另一个在每个文档上都有 uid 的博客的 firestore 表。我想通过他们的uid加入两个表来做加入查询。我在火灾测验状态管理中找不到这样做的方法。我想定义一个新的类。
BlogData<T> {
final Firestore _db = Firestore.instance;
final String path;
CollectionReference ref;
BlogData({ this.path }) {
ref = _db.collection(path);
}
Future<List<T>> getData() async {
// get blog data and do a join here to a user document by uid (document/blog.uid) return a future of blogs with user data such as name, country added to each blog in the future list.
}
Stream<List<T>> streamData() {
// get blog data and do a join here to the user document by uid (document/blog.uid) return a stream of blogs with user data such as name, country added to each blog in the stream.
}
}
我怎样才能做到这一点?
解决方案
推荐阅读
- mvvm - 具有复杂 MVVM 的 SwiftUI(存储库 + 嵌套 ObservedObject)
- java - 为什么在android webview中授予相机权限后再次打开应用程序时相机会工作?
- azure - 向 ARM 模板参数文件添加新参数
- jsonschema - 如何在 json 模式中指示动态添加支持?
- javascript - 如何在键入时使“数字”输入不可编辑?
- python - 使用 node js 进行非对称加密和使用 Python 进行解密
- reactjs - 使用 dangerouslySetInnerHTML 解析 HTML 时如何忽略 img 标签?
- sql-server - 来自 SQL Server 的 Moodle 身份验证
- javascript - 如何使用 React js 向 webengage 事件发送动态值
- python - 尝试使用意外的 mimetype 解码 JSON:text/html