Closed
Description
Library | Class | Member | Platforms |
---|---|---|---|
Firestore | collection | select | all |
Would be useful to support retrieving only specific fields from Firestore documents.
Something like:
fun getCities() = flow {
firestore.collection("cities")
.select("name", "population")
.snapshots.collect { snapshot ->
val cities = snapshot.documents.map { doc ->
doc.data<City>()
}.sortedBy { it.name }
emit(cities)
}
}
Idea is to only fetch needed fields and prevent network-transport of potentially heavy documents.