Couchbase view query not returning all matching documents

127 views Asked by At

I created a view with two fields as key for the index like this [type, time]. When I tried to fetch the documents using the below query I was missing some of my documents in the resultset.

Javascript view I used looks something like this:

function(doc,meta) { 
   if(doc.name==type_1)
     emit([type_1,doc.time],doc);
   else if(doc.name==type_2) 
     emit([type_2,doc.time],doc);
 }

here type_1 and type_2 are document types mentioned above

Query I used:

URL/VIEW_PATH?stale=update_after&inclusive_end=true&connection_timeout=60000&limit=10&skip=0&startkey=[type,start_time]&endkey=[type,end_time]&full_set=true

I had one document which should be there in the result. But I didn't get any.

Am I doing something wrong here?

Couchbase Version: 3.1.6-1904 Enterprise Edition (build-1904)

Number of documents in my bucket ~5M

0

There are 0 answers