Hi,
i have a data query function at the backend with limit(4) as an example that returns the results.
when I want to get the next page with results.next().then… It says next() isnt a function.
as long as I declare the data query function on page code it works perfectly.
Hey
If you set limit(4) you have defined the size of the result. If you want to call that function from frontend code but get the next 4 items you need to make the function accepting startIndex and Limit so you can ask the function to get the next 4 items for you. The results you get back to your frontend code only consists of an array with four items, it is not a property that holds functions like .next().
getItems(4,0).then((myItems) => {
console.log(myItems); //will be first 4 items
})
getItems(4,4).then((myItems) => {
console.log(myItems); //will be next 4 items
})
So you work with the skip property to get to a certain page when working with backend code. Or I do at least, that does not mean it is the way to do it