Post execution, i am getting few repetitive rows and even though the total records is around 1000 for particular small scenario i get around 3000+ rows in response and it keeps going.
can someone please tell me if i am doing something wrong ?? PS: My start key value will be same for each run as i am trying to get each unique doc _id.
Are documents on couchbase stored in sequenced/sorted order of _id?
Take a look at these articles that describe the proper use of startKeyDocId parameter and how to paginate large result sets. In a nutshell, the document identified by startKeyDocId should exist and be indexed by the view, and strange things can happen if it doesn’t. For pagination, instead of using skip, the recommended approach is to use keyset pagination by specifying a new startKey and startKetDocIdfor each loop iteration, so you start from the end of the previous page.
Note that the second article refers to Couchbase SDK 2 which is EOL, but the general concepts are still valid. Also be aware that the Views service is deprecated in Couchbase 7; if you’re developing a new app, N1QL will be more future-proof.
so my startKey is [“IND”,“INVALID”] and endKey is [“IND”,“INVALID”,] and i want to extract on document id.
in this case i am trying to provide my last document ID as startkeyDocID but my startKey will remain same for my each extract.