
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
- 2 Columns still processing since yesterd...
Hey o/ Yesterday (around <t:1758045600:f>), I created a database and added several columns to it. After about 15 minutes, most of the "processing" tags disappe...
- 503 Timeout when Updating or Upserting D...
Hey I’m running into an issue when trying to update or upsert a row in Appwrite. The request hangs for a while and then throws this error: ``` AppwriteException...
- Row with the requested ID already exists...
I’m hitting a blocking issue creating rows in Appwrite (both from the console and my React Native app). After successfully inserting the first row, every subseq...
