You need to define a view, using the name as at least part of the key or create a list. Then
you can filter using the key in a view or some parameter you pass using a list.
I suggest taking a look a Max Ogden's talk on CouchDB. It's a great jumpstart for a newbie.
http://vimeo.com/18808177
- Jim
On May 15, 2011, at 1:34 PM, Alexander Gabriel <alex@barbalex.ch> wrote:
> Hi
> I want to fetch documents from a CouchDb named evab. The documents include a
> field "Typ" and I want to fetch those with Typ = Beobachtung.
>
> So far I've tried:
>
> - curl -d "{\"Typ\":\"Beobachtung\"}" -X POST
> http://username:secretpassword@127.0.0.1:5984/evab/_bulk_docs?include_docs=true>
> Beobachtungen.json
> - curl -d "{\"docs\": [{\"Typ\":\"Beobachtung\"}]}" -X POST
> http://username:secretpassword@127.0.0.1:5984/evab/_all_docs?include_docs=true>
> Beobachtungen.json
> - replacing {\"Typ\":\"Beobachtung\"} or {\"docs\":
> [{\"Typ\":\"Beobachtung\"}]} with "@TypBeob_Kriterien.json" to circumvent
> problems with the windows-command-tool and " or '.
>
> I consistently get all the data of all the docs in the CouchDb.
>
> From the documentation I have not understood:
>
> - _all_docs or _bulk_docs? It seems that both work the same.
> - Is ist maybe only possible to filter with keys = _id's?
> - Is it possible to fetch the data from a view?
>
>
> Or simply: What is the best way to do it?
>
> Thanks for help!
>
> Alexander Gabriel
|