couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Anderson <jch...@apache.org>
Subject Re: How to change/extend the show page of a document?
Date Sat, 13 Jun 2009 18:47:52 GMT
2009/6/12 Pérès Vincent <vincent.peres@gmail.com>:
> Hello,
>
> Thanks for your answer! So for the following URL :
> http://localhost:5984/markers_development/_design/markers/_view/full
>
> I have the following results :
>
> {"total_rows":5,"offset":0,"rows":[
> {"id":"6aa77856599e0fd0b3e84e1369c7cdfb","key":"6aa77856599e0fd0b3e84e1369c7cdfb","value":{"name":"lyon"}},
> {"id":"b04d2d2524c8adf5075fbf5e1bae2118","key":"b04d2d2524c8adf5075fbf5e1bae2118","value":{"name":"Strasbourg"}},
> {"id":"d0d2605d5ccbf6e0726d7604279cad70","key":"d0d2605d5ccbf6e0726d7604279cad70","value":{"name":"Paris"}},
> {"id":"df8144f371bc9ef5e49c7499ea7c0dc3","key":"df8144f371bc9ef5e49c7499ea7c0dc3","value":{"name":"Strasbourg"}},
> {"id":"paris","key":"paris","value":{"name":"Paris"}}
> ]}
>
> But with :
> http://localhost:5984/markers_development/_design/markers/_view/full?key=paris
>
> I got the following error :
> http://localhost:5984/markers_development/_design/markers/_view/full?key=paris
>
> -------
>
> Wow I just resolve the issue by using quote for the key :
> http://localhost:5984/markers_development/_design/markers/_view/full?key=%22paris%22
>

For future reference the quotes are necessary because the key can be
any JSON object not just a string, which gives even more flexibility.

Enjoy!

> It's working, thanks to you :)
>
> Vincent
>
> On Fri, Jun 12, 2009 at 11:23 PM, Dmitry Unkovsky <oil.crayons@gmail.com>wrote:
>
>> I'm new to couchdb, but as I recall, view can accept number of
>> parameters, you can see them here -
>>
>> http://wiki.apache.org/couchdb/HTTP_view_API#head-d288caa8951ff266fb230d364e5c690c4fd7a28a
>>
>> Hope that helps.
>>
>



-- 
Chris Anderson
http://jchrisa.net
http://couch.io

Mime
View raw message