I am using the javascript library which comes bundled with couchdb to query the database.
It is possible to filter the results from a view by specifying the key values to return. This is easily done with a query string (documentation) but how do I do it with the javascript API?
This is how I am doing it with a query string (please note that the JSON portion of the key-value-pair would need to be HTML encoded):
http://localhost:5984/MyDocuments/_design/MyDesign/_view/MyView?key=["Michael","2011-08-01"]
And this is my javascript without the query string portion of the filtering process applied.
$.couch.db("MyDocuments").view("MyDesign/MyView", { success: function(data) { console.log(data); }, error: function(status) { console.log(status); }, reduce: false });