In case when primary key is not known, and query is done based on indexed fields only, the pageState is returned but it doesn't work. Always returns the same result set.
getDataByQuery(query) {
query.limit = query.limit || 1;
const options = {
fetchSize: parseInt(query.limit),
pageState: query.nextPage,
raw: true,
allow_filtering: true
};
const dbQuery = {
courseId: query.courseId,
assignmentId: query.assignmentId
}
const rows = [];
return models.instance.Clickstream.eachRowAsync(dbQuery, options, (count, row) => {
rows.push(row);
}).then((result) => ({
rows: rows,
nextPage: result.pageState
}));
}
When the function is invoked with new pageState
it again returns the same result set. The above code works only if query is done through the primary key (Id)
via adnan kamili
No comments:
Post a Comment