couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pablo Sortino" <psort...@gmail.com>
Subject Is CouchDB allowing the use of "startkey_docid" parameter in views?
Date Tue, 25 Nov 2008 13:58:51 GMT
A view with startkey_docid is not working.
It is working if I use _all_docs.

For the following database named "psortino" with a view (username):

The "username" view is: function(doc) { emit(doc.username, null) }

1) http://localhost:5984/psortino/_all_docs
{"total_rows":6,"offset":0,"rows":[
{"id":"048cdb8d0971e625e86730ffc10eda0d","key":"048cdb8d0971e625e86730ffc10eda0d","value":{"rev":"2554919371"}},
{"id":"056492cd6da7f36a967fdcd58d749850","key":"056492cd6da7f36a967fdcd58d749850","value":{"rev":"3482973537"}},
{"id":"_design/foo","key":"_design/foo","value":{"rev":"192023970"}},
{"id":"a8b7bff9d9cdc66a9799d97941f9e1d3","key":"a8b7bff9d9cdc66a9799d97941f9e1d3","value":{"rev":"998738065"}},
{"id":"ef20ce5f076d05c567535f9ae3835a43","key":"ef20ce5f076d05c567535f9ae3835a43","value":{"rev":"2828544738"}},
{"id":"ff51c5fa2c4f2b6ad2859d28d0017ae3","key":"ff51c5fa2c4f2b6ad2859d28d0017ae3","value":{"rev":"242782642"}}
]}


2) http://localhost:5984/psortino/_view/foo/username
{"total_rows":5,"offset":0,"rows":[
{"id":"056492cd6da7f36a967fdcd58d749850","key":"mdixon","value":null},
{"id":"ef20ce5f076d05c567535f9ae3835a43","key":"mdixon","value":null},
{"id":"ff51c5fa2c4f2b6ad2859d28d0017ae3","key":"mdixon","value":null},
{"id":"048cdb8d0971e625e86730ffc10eda0d","key":"nsantos","value":null},
{"id":"a8b7bff9d9cdc66a9799d97941f9e1d3","key":"sbristow","value":null}
]}


3)
http://localhost:5984/psortino/_all_docs?startkey_docid=a8b7bff9d9cdc66a9799d97941f9e1d3
{"total_rows":6,"offset":3,"rows":[
{"id":"a8b7bff9d9cdc66a9799d97941f9e1d3","key":"a8b7bff9d9cdc66a9799d97941f9e1d3","value":{"rev":"998738065"}},
{"id":"ef20ce5f076d05c567535f9ae3835a43","key":"ef20ce5f076d05c567535f9ae3835a43","value":{"rev":"2828544738"}},
{"id":"ff51c5fa2c4f2b6ad2859d28d0017ae3","key":"ff51c5fa2c4f2b6ad2859d28d0017ae3","value":{"rev":"242782642"}}
]}


4)
http://localhost:5984/psortino/_view/foo/username?startkey_docid=048cdb8d0971e625e86730ffc10eda0d
{"total_rows":5,"offset":0,"rows":[
{"id":"056492cd6da7f36a967fdcd58d749850","key":"mdixon","value":null},
{"id":"ef20ce5f076d05c567535f9ae3835a43","key":"mdixon","value":null},
{"id":"ff51c5fa2c4f2b6ad2859d28d0017ae3","key":"mdixon","value":null},
{"id":"048cdb8d0971e625e86730ffc10eda0d","key":"nsantos","value":null},
{"id":"a8b7bff9d9cdc66a9799d97941f9e1d3","key":"sbristow","value":null}
]}

--- Here ---> 4) should returns
[{"id":"048cdb8d0971e625e86730ffc10eda0d","key":"nsantos","value":null},
{"id":"a8b7bff9d9cdc66a9799d97941f9e1d3","key":"sbristow","value":null}]

Is this a bug? or we can't use startkey_docid with views?
Is there something wrong on my url?

The same happens for "endkey_docid" parameter.
I found the same issue on versions 0.8 and 0.9


Thanks in advance.
Pablo.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message