This may be an issue with trying to reference timestamps in Firebase (see this thread for more detail), I'm seeing similar errors when trying to use a timestamp as a cursor for pagination. Based on that thread it looks like the only solution might be to use raw queries which would also mean setting up custom pagination with something like this.
The following seems to work as a Firebase query that'll pull back paginated data:
You can see it working in an app if you import the attached JSON file and hook up your Firebase resource, then replace the values for TIMESTAMP_KEY and COLLECTION_NAME with "created_at" and the name of your collection respectively.
It's a doozy of a workaround I can let you know here if better handling for Firebase timestamps is included. Also very open to hearing others' approaches here! firebase_pagination_on_timestamp (1).json
I'm trying to implement what you have suggested. The methods have changed slightly but my code I'm using (based on your recommendation) is below. It works for the first fetch, on page load. But doesn't seem to do anything when pressing the 'next' arrows on the table. It doesn't call the pagination query again.
Hi @Joe_dare, it looks like "data" is not defined in the query you shared. I tried @Kabirdas' query on my end and I got it to work by making a small change to it.
Try this approach using the new Table Component, and it should work like a charm:
Add-ons:
"Pagination: Server-side."
Any other add-on you need.
Event handlers:
"Change page: queryWeAreWorkingOn.trigger()"
Here is the setup that works on my end:
Here is the query so you can just copy and try on your end:
This solution works perfectly but requires changing the line let createdAtValue = values[TIMESTAMP_KEY];
to let createdAtValue = values[TIMESTAMP_KEY].seconds * 1000;
Otherwise, getting dates like 1970-01-20T21:42:46.351Z.