
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
- Change attributes of existing collection...
I'm trying to figure out how to add a new attribute to this empty collection, but the only prompt that shows up is the "create document." Nothing shows up in se...
- Attribute already exists in schema
I created an attribute, deleted it and now I can't create it again. It says "Failed" and "Attribute already exists in schema". ```json { "27": { "ke...
- Decentralisation
I had queries regarding decentralisation with self hosting, particularly with sites as a recent addition. Can we decentralise sites as in many cases we would li...
