Open Daplex opened 9 months ago
Hey, @Daplex, thank you for reporting that, and sorry for the silence. I was on vacation. I will investigate and share a solution or publish an update that fixes it.
I am facing the same issue, the pagination doesn't work, it only repeats the same page. I tried it with vanilla firebase/firestore
and passed the snapshot object and pagination worked just fine.
ProductCollection(context)
.query(($) => [
$.field('updatedAt').order('desc'),
$.field($.docId()).order('desc', $.startAfter(lastProduct ? ProductId(context, lastProduct?.id) : undefined)),
$.limit(30),
])
I use:
db.xxxx.query(($) => {
return [
$.field('created_at').order('desc'),
...(cursor ? [$.field($.docId()).order($.startAfter(cursor))] : []),
$.limit(PAGE_SIZE),
];
})
throw error:
The query requires an index. You can create it here: https://console.firebase.google.com/v1/r/project
Hi!
I've got an issue having a query working with a sort by.
I'm trying to sort by a field and then paginate thanks to the
docId
ofafter
which is the last element of the previous page.The
startAfter
doesn't seem to work, maybe because there are twoorderBy
in the query.I've managed to have this use case working with the
firebase-admin
sdk:Thanks for the help!