Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Pagination / Compound query] Would it possible with Multiple Field Cursor Query? #119

Open
jackie-d opened this issue Apr 15, 2020 · 0 comments

Comments

@jackie-d
Copy link

Hello, looking at a solution for pagination / compound query / ranged query.

I've found the following on the Firestore doc:
https://firebase.google.com/docs/firestore/query-data/query-cursors#set_cursor_based_on_multiple_fields

It says:

When using a cursor based on a field value (not a DocumentSnapshot), you can make the cursor position more precise by adding additional fields. This is particularly useful if your data set includes multiple documents that all have the same value for your cursor field, making the cursor's position ambiguous. You can add additional field values to your cursor to further specify the start or end point and reduce ambiguity.

Would it in any way helps to solve this problem?

For some tests I've tried to modify your library:

GeoFireQuery.prototype.queryPoint = function (geohash, field) {
    var end = geohash + '~';
    return this.ref
        .orderBy('time')
        .orderBy(field + ".geohash")
        .startAt(1586629840864, geohash)
        .endAt(1586867311877, end);
};

but I got duplicated query results.

Any idea? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant