Hello,
Today I found a weird behaviour using Couchbase Server(4.1.0-5005 Enterprise Edition (build-5005) from docker) and Sync Gateway(1.2 from docker).
I created a view through Couchbase Sync Gateway to filter some data by client phone number to be used in a front-end with pagination. Everything was working fine. If I sent “limit=10&skip=10” it would skip the first 10 rows and show the next rows limiting to 10.
Today I arrived at the office and the pagination was not working.
% http --session=test http://localhost:8092/default/_design/clients/_view/list_by_client_number\?inclusive_end\=true\&stale\=false\&connection_timeout\=60000\&limit\=10\&skip\=10
HTTP/1.1 200 OK
Cache-Control: must-revalidate
Content-Type: text/plain;charset=utf-8
Date: Mon, 11 Apr 2016 08:35:33 GMT
Server: MochiWeb/1.0 (Any of you quaids got a smint?)
Transfer-Encoding: chunked
{"total_rows":68,"rows":[
]
}
% http --session=test http://localhost:8092/default/_design/clients/_view/list_by_client_number\?inclusive_end\=true\&stale\=false\&connection_timeout\=60000\&limit\=10
HTTP/1.1 200 OK
Cache-Control: must-revalidate
Content-Type: text/plain;charset=utf-8
Date: Mon, 11 Apr 2016 08:35:44 GMT
Server: MochiWeb/1.0 (Any of you quaids got a smint?)
Transfer-Encoding: chunked
{"total_rows":68,"rows":[
{...},
{...},
{...},
{...},
{...},
{...},
{...},
{...},
{...},
{...}
]
}
What was happening is that the query was being limited and the using skip. So if want “limit=10&skip=10” it would return 0 rows, but if I ran “limit=20&skip=10”, it would work as “limit=10&skip=10”.
I restarted the Couchbase Server and Couchbase Sync Gateway but still having the same issue. After we recreated the view, everything was working again as expected.
Anyone else experienced something similar?