Hello,

I am trying to get to grips with Couchdb. Though it looks very interesting, I just dont understand how to query Couchdb for an abitrary value, as is possible with sql. Imagine I had a number of very simple documents, like:

{"_id":"b1","_rev":"3573740128", "book":"Potter","author":"Rowling"}

and I wanted to find all books written by Mr Tolkien?

I could create a view like:

function(doc) { if (doc.author == "Tolkien") emit(null, doc); }

and then query:

http://127.0.0.1:5984/books/_view/byauthor/tolkien

Is there any way to pass "Tolkien" as a variable to the view, or do I have to create a new view, every time I want to query for another keyword?

Thanks

Bernd

Reply via email to