我有一个用户的Firestore表,以及另一个博客的Firestore表,每个文档上都有uid。我想通过两个表通过其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.
}
}
我该如何实现?