
I'm following the docs,
https://appwrite.io/docs/pagination#cursor-pagination, so do I need to write the code again and again for each page?
And I'm getting an error saying Cannot read properties of undefined (reading 'length')
this is my function
"647ac763cf53edxxxxx",
"647ac820ba3852xxxxx",
[
Query.orderDesc("age"),
Query.notEqual("age", ["invalid"]),
Query.limit(25)
]
);
const lastId = page1.documents[page1.documents.length - 1].$id;
// Page 2
const page2 = databases.listDocuments(
'647ac763cf53edxxxxx',
'647ac820ba3852xxxxx',
[
Query.limit(25),
Query.cursorAfter(lastId),
]
);
page1.then(function (response) {
console.log(response.documents);
var tableHTML = generateTable(response.documents);
var tableContainer = document.getElementById('tableContainer');
tableContainer.innerHTML = tableHTML;
}, function (error) {
console.log(error);
});
page2.then(function (response) {
console.log(response.documents);
var tableHTML = generateTable(response.documents);
var tableContainer = document.getElementById('tableContainer');
tableContainer.innerHTML = tableHTML;
}, function (error) {
console.log(error);
});```

I highly suggest you do some research or tutorials on promises to understand how they work and how to use them

I solved my error, thanks🫡
Recommended threads
- my database attribute stuck in processin...
when i created attributes in collection 3 of those attributes become "processing", and they are not updating, the worst thing is that i cant even delete them s...
- Forever Processing Issue
I encountered an issue when creating attributes in the collections . if you create an attribute of type string for example and choose a size of 200 or 250 or a...
- Realtime Disconnects and Error: INVALID_...
Hi! I just want to ask here if there's any workaround with the disconnect issues we're encountering when subscribing to realtime events in react native using ex...
