Created
March 1, 2020 19:01
-
-
Save hiranya911/e807286c72bd4ead289865ec708bcec3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class City( | |
val name: String? = null, | |
val state: String? = null, | |
val country: String? = null, | |
val isCapital: Boolean? = null, | |
val population: Long? = null, | |
val regions: List<String>? = null | |
) | |
db.collection("cities") | |
.whereGreaterThan("population", 1000000) | |
.get() | |
.addOnSuccessListener { snapshot -> | |
for (doc in snapshot) { | |
val city = doc.toObject(City::class.java) | |
displayCity(city) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment