I\'m trying to make a paginated filtered list with firebase and swift (but feel free to answer with the programming language that you like the most) without filter the retrieved
If I recall correctly, you can pass in the key of the first item to return as a second argument to queryStarting
. From the documentation (emphasis mine):
queryStartingAtValue:childKey:
is used to generate a reference to a limited view of the data at this location. TheFIRDatabaseQuery
instance returned byqueryStartingAtValue:childKey
will respond to events at nodes with a value greater than startValue, or equal to startValue and with a key greater than or equal to childKey.
So in code that would then be:
matchesRef
.queryOrdered(byChild: "users/user-1")
.queryStarting(atValue: "ok", childKey: "<last-fetched-user-id>")
.queryLimited(toFirst: 5)
.observe(.value, with: { snapshot in