Skip to content
This repository was archived by the owner on Nov 18, 2024. It is now read-only.
This repository was archived by the owner on Nov 18, 2024. It is now read-only.

Query works twice with startAfter(lastVisible) clause. #16

@nasirhasanov

Description

@nasirhasanov

I am using Geoquery to fetch nearest documents from Firestore in Android/Java. I try to paginate data with recyclerview. But somehow, .startAfter(lastVisible) clause makes the query work twice for different bound tasks. So, after first fetch, all queries works twice.

List<GeoQueryBounds> bounds = GeoFireUtils.getGeoHashQueryBounds(center, radiusInM);
final List<Task<QuerySnapshot>> nextTasks = new ArrayList<>();
for (GeoQueryBounds b : bounds) {
Query nextQuery = db.collection("posts")
.whereEqualTo("country_code", sharedpreferences.getString("country_code", ""))
.orderBy("geohash")
.startAt(b.startHash)
.endAt(b.endHash)
.startAfter(lastVisible)
.limit(10);
nextTasks.add(nextQuery.get()); }

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions