我在Firebase服务器中有一组歌曲。 每首歌都有lastCommentAt
属性,它是时间戳。Firebase按日期排序(时间戳) - Firebase
我想检索到当前时间最近的lastCommentAt
时间的歌曲顺序。
这是我的火力地堡规则:
{
"rules": {
".read": true,
".write": "auth != null",
"songs": {
".indexOn": ["lastCommentAt"]
}
}
}
我不能使用orderByChild()。这使得奇怪的问题:
Uncorrect为了
loadMore()加载相同的2首歌曲的循环。这意味着无限制的 歌曲列表。
Songs feed with orderByChild() example - CodePen