I am currently trying to create a view and a query according to this SQL query:
SELECT * FROM articles
WHERE articles.location="NY" OR articles.location="CA"
ORDER BY articles.release_date DESC
I tried to create a view using a complex key:
function(doc) {
if(doc.type == "Article") {
emit([doc.location, doc.release_date], doc)
}
}
And then using the start key and the final key to get one location and arrange the result by release date.
.../_view/articles?startkey=["NY", {}]&endkey=["NY"]&limit=5&descending=true
This works great.
However, how can I send a few start and end keys to my view to simulate
WHERE articles.location="NY" OR articles.location="CA"?
source
share