I have a question about sorting. I want to get the first 10 posts added today, this week, and this month (So I have 30 posts total but each 10 posts from a different part of the database). This works perfect but the problem is that I want to sort all of them by voteCount
'.
Is there any way to sort them by date
and voteCount
?
My reference:
const ref = firebase.database().ref('bookmarks')
.orderByChild('date')
.startAt(date.end)
.endAt(date.start)
.limitToLast(10)