I have a Firebase query going on into a 10k database. I don’t want the query to take ages, so I get 50 records at a time, process them for what I want, and store the final record in each search as the reference point to start the next search from. So essentially something like: […]
Categories
Flutter/Firebase data pagination – again
- Post author By Full Stack
- Post date September 26, 2020
- No Comments on Flutter/Firebase data pagination – again
- Tags 000 records, 13 records. If, and store the final record in each search as the reference point to start the next search from. So essentially something like: qs = a, but I can't get anywhere near the same number of records returned if I limit the query size. I can't work out what is going wrong here, but it's just not happening. Any ideas?, descending: true) .startAtDocument(lastItemSeen[quadIndex]) .limit(kQuerySize) .get(); if qs.docs.isNotEmpty I, However, I have a Firebase query going on into a 10k database. I don't want the query to take ages, I remove the .startAtDocument and the .limit(kQuerySize) I get around 60 records. The loop is run multiple times (largely by the user), isGreaterThanOrEqualTo: boundaryGeoHash1) .where('geohash', isLessThanOrEqualTo: boundaryGeoHash2) .orderBy('geohash', like so: if ( qs.docs.isNotEmpty ) { List dS = qs.docs.toList(); lastItemSeen[quadIndex] = dS[dS.length - 1];, process them for what I want, so I get 50 records at a time, so it should simply march on to the end of the database and give me all the records as per the unlimited query, this returns (after a bunch of other processing), though. The lastItemSeen variable is never reset