Hi,
I am trying to do manual pagination using cassandra-driver npm module. Pagination works fine when I am storing pagestate in global variable but when I store pagestate in session (using node.js express project), it throws error TypeError has no copy method.
Following is the snippet used in one of the routes in the express:
var options={pageState:req.session.pageStateMeta,prepare : 1 , fetchSize : 50};
var data=[];
var responseObj=DMUtil.Response();
cassandraClient.eachRow(query,[],options,function (n, row) {
data.push(row);
}, function (err, result) {
// End callback.
// Store the paging state.
if(!err && result){
req.session.pageStateMeta = result.meta.pageState;
}
responseObj.responseData=data;
res.send(responseObj);
});
In first call to this route its getting data but in next call, its not able to use req.session.pageStateMeta and throws following error
[TypeError: Object 0,0,0,61,0,8,0,0,1,74,75,62,148,0,0,0,2,117,115,0,0,4,0,0,0,7,0,0,19,68,73,83,80,76,65,89,95,65,68,86,69,82,84,73,83,73,78,71,0,0,3,65,76,76,0,0,4,7,173,159,179,0,0,0,0,127,255,255,205 has no method 'copy']
Has anyone of you faced this issue.