我在Firebase服務器中有一組歌曲。 每首歌都有lastCommentAt
屬性,它是時間戳。Firebase按日期排序(時間戳) - Firebase
我想檢索到當前時間最近的lastCommentAt
時間的歌曲順序。
這是我的火力地堡規則:
{
"rules": {
".read": true,
".write": "auth != null",
"songs": {
".indexOn": ["lastCommentAt"]
}
}
}
我不能使用orderByChild()。這使得奇怪的問題:
Uncorrect爲了
loadMore()加載相同的2首歌曲的循環。這意味着無限制的 歌曲列表。
Songs feed with orderByChild() example - CodePen