I have a firestore table of users, and another firestore table of blogs which has uid on each document. I would like to do join query in flutter by joining the two tables by their uid. I can't find a way of doing this in the fire quiz state management. I wanted to define a new class class.
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.
}
}
How can I achieve this?
> getData()`, see https://stackoverflow.com/questions/51643007/flutter-query-multiple-collections-in-firestore
– Frank van Puffelen Nov 22 '19 at 23:01