When I query some view in Couchbase using user_id(key), limit(10) and skip(0) parameter, I get the response that has following structure:
{
"total_rows":1896,
"rows":[...]
}
Here is my view who return list of reports based on user_id:-
function map(doc, meta) {
if (doc.type == 'report' && doc.subscribed) {
for (var subscriber in doc.subscribed) {
emit(subscriber, doc);
}
}
}
here is the sample report doc:-
{
"agree_allowed":true,
"assigned_by":"",
"assigned_to":"",
"closed":[
],
"comments_allowed":true,
"details":"Test",
"email":"",
"status":"In Progress",
"subscribed":{
"user_cfd29b81f0263a380507":true,
"user_cfd29b81f0263a380508":true,
"user_cfd29b81f0263a380509":true,
"user_cfd29b81f0263a3805010":true
},
"summary":"Test",
"time_open":0,
"timestamp":"2015-07-17T15:34:30.864Z",
"type":"report",
"user_id":"user_cfd29b81f0263a380507",
"username":"test17"
}
but rows count is 3, so if i want to achieve pagination how can i get total count, So it can be useful for pagination.