My data in firebase looks like
Can I do a select distinct on the Genre node using the REST API of firebase?
When you read a tree in Firebase, you get all the children. There's no way around this.
You can however, create a data structure that holds just the genres per movie.
{
"movieGenres": {
"3646": {
"0": "Comedy"
},
"3647": {
"0": "Drama"
},
"3648": {
"0": "Horror",
"1": "Sci-Fi"
}
}
}
Now getting the genres is a simple read.