Skip to content

Paged view, descending order by Date not working correctly #91

@brettski

Description

@brettski

When ordering by a date field, descending and using the data field for a startAfter value, the last value from the previous page is the first value of the new page. Date fields used for paging in ASCENDING order work as expected still.

Something changed either at Firestore or the Firestore SDK. The only workaround found at this time is to remove 1 ms from the time sent in the cursor. For example as done in order:

      const curCreatedAt = new Date(lastdoc.createdAt.getTime() - 1);
      const cpieces = JSON.stringify({
        curCreatedAt,
        curEventId: eventId || '',
      });

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcritical

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions