I have the following hierarchy:
I am using this table to generate real-time search updates for my searchBar
and I want to make the following things:
If a user searches for "dsa", show him the results for "dsa". (Done)
ref.queryOrderedByKey() .queryStarting(atValue: queryLower) .queryEnding(atValue: queryLower + "\u{f8ff}") ...
User will be able to select from which table the results to be shown so I embedded the table names as a value in order to search for them. I want, when a user selected the button Search in Sports Center, with a value of "dsa" to show him only the "dsa" results that have a value of "sports center".
To make this work I was thinking:
ref.queryOrderedByKey()
.queryStarting(atValue: queryLower)
.queryEnding(atValue: queryLower + "\u{f8ff}")
.queryOrderedByValue()
.queryEqual(toValue: tableName)
...
The problem is that it crashed on .queryOrderedByValue
. Seems like you can't chain query ordering or I don't know how.
How can I make this work or is it a better architecture I can employ to solve my problem?