How would I do a call to Firebase with multiple "WHERE" conditions?
this is my db:
users: {
324234: {
username: "admin"
...
}
}
tracks: {
12: {
title: "Sample song"
creatorId: 324234
played: 24
...
}
}
What I'm trying to do is in pseudo-sql:
SELECT FIRST 10 WHERE 'title' == searchQuery SORTED BY 'played'
I also want to be able to add: WHERE 'creatorId' == 324234
to the query.
I have gotten the search to work like this:
query = getTracksRef()
.orderByChild("title")
.startAt(query)
.endAt(query + "\uf8ff")
.limitToFirst(10);
And the sort to kinda work by sorting the items after I've gotten them from Firebase.
However because you can't have mutliple "orderBy" calls I simply don't know how to continue implementing the other conditions.