View is skipping a document

When using this view:

function (doc, meta) {
if (doc.type == “recording” && == “------”) {
for (var i=0; i<; i++) {
for (var[i].time; j<[i].duration +[i].time; j++)
(basically i have 39 recordings, each holding a list of events. I want the view to return events with time steps of 1 second)

It is returning events from 38 of my 39 recordings. I’ve checked events exist in the 39th, and their duration and time is fine. What is strange is that if I change the qualifier on the second ‘if’ to

j<[i].duration +[i].time - 10;

I start getting events from all 39 recordings. This doesn’t make sense to me, as it reduces the range of the query. Is there a limit on the number of results a view can return, and I happen to be right on the edge? Is this a bug?

After more testing, it seems to be related to how many results the view needs to return. If I change j++ to j+=0.5 it produces around a quarter of the results. The view is bugging out when there are too many results, but doesn’t show any kind of error.

Running Couchbase Server 4.6.1