Firebase Structure
Let's say I have a list of posts with author and language
posts
|-ID1
|--text: "bla bla"
|--author: "Mario"
|--lang: "it"
|-ID2
|--text: "bla bla"
|--author: "Mario"
|--lang: "en"
|-ID3
|--text: "bla bla"
|--author: "Tom"
|--lang: "en"
I would like to have flexibility on reading data by author and by language... but In Firebase I caot combine both (to have the posts from Mario written only in englis)
getReference("posts").orderByChild("author").equalTo("Mario").orderByChild("lang").equalTo("en")
the exception is
java.lang.IllegalArgumentException: You can't combine multiple orderBy calls!
at com.google.firebase.database.Query.zzPm(Unknown Source)
at com.google.firebase.database.Query.orderByChild(Unknown Source)
Are we oblidged to flatten the data structure for every search criteria we would like to use as filter?
In this case I will have a DB structure containing posts, one containing post organized by author, one organized by language...
