incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Davis <paul.joseph.da...@gmail.com>
Subject Re: startkey_docid
Date Wed, 26 Aug 2009 14:05:33 GMT
Daniel,

Hey, startkey_docid only takes effect for identical keys. Internally
CouchDB stores keys as a tuple like {RowKey, DocId}. Generally,
startkey_docid is only used when paging through views.

HTH,
Paul Davis

On Wed, Aug 26, 2009 at 5:55 AM, Daniel Trümper<truemped@googlemail.com> wrote:
> Hi everyone,
>
> the view reference in the wiki tells me that there is an option
> "startket_docid". Unfortunately there is not that much documentation about
> this specific option. In my map function I am emitting the document id as
> key. So what I am expecting is this:
>
> 1st call:
> limit=3&reduce=false
> {"id":"2c0c44638d24065e3b42a3c3359b3cfe","key":"2c0c44638d24065e3b42a3c3359b3cfe","value":1},
> {"id":"3caef4d0f49828d491f8bf7e4c1ee10","key":"3caef4d0f49828d491f8bf7e4c1ee10","value":1},
> {"id":"47e86f9cdee06a132fe943e1fe5b8892","key":"47e86f9cdee06a132fe943e1fe5b8892","value":1}
>
> 2nd call:
> limit=3&skip=1&reduce=false&startkey="47e86f9cdee06a132fe943e1fe5b8892"
> {"id":"4c9df084a273d3126f2cabfde910c4e5","key":"4c9df084a273d3126f2cabfde910c4e5","value":1},
> {"id":"580de6655f622debefeebc0d4c6dddd4","key":"580de6655f622debefeebc0d4c6dddd4","value":1},
> {"id":"771a3cc200d00c898c26a4d3efe651b4","key":"771a3cc200d00c898c26a4d3efe651b4","value":1}
>
> But when I use "startkey_docid" I get:
> limit=3&skip=1&reduce=false&startkey_docid="47e86f9cdee06a132fe943e1fe5b8892"
> {"id":"3caef4d0f49828d491f8bf7e4c1ee10","key":"3caef4d0f49828d491f8bf7e4c1ee10","value":1},
> {"id":"47e86f9cdee06a132fe943e1fe5b8892","key":"47e86f9cdee06a132fe943e1fe5b8892","value":1},
> {"id":"4c9df084a273d3126f2cabfde910c4e5","key":"4c9df084a273d3126f2cabfde910c4e5","value":1}
>
> I have tried this with more than 3 documents per page and the document id
> passed to the startkey_docid is always the 2nd last document.
>
> Obviously in my setup I can use the "startkey" parameter, but is this
> behaviour of startkey_docid intended? Or to be more precise: what exactly is
> the semantics of this parameter??
>
> Cheers,
> Daniel
>

Mime
View raw message