【发布时间】:2019-12-07 04:42:20
【问题描述】:
我需要查询字段并获取所有子集合和字段。有可能吗?
Stream<List<ChatFieldModel>> getChatField(String uid) {
var ref = _db.collection('chats')
.where('toUserId', isEqualTo: uid);
//Afterthat need to get sub collection with sub collection list of documents and main collection fields value. is it possible?
return ref.snapshots().map((list) => list.documents
.map((doc) => ChatFieldModel.fromForestore(doc))
.toList());
}
【问题讨论】:
标签: firebase flutter dart google-cloud-firestore