CouchDB considers a request with multiple key values

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"?

+5
source share
2 answers

My army of Nemesis, Dominic, is right.

, A, B CouchDB. , CouchDB , , . .

  • B
  • , ,
    • ,
    • , _list. , , . , _list, , .
+7

: /.

2 , lucene, .

key. . Couchbase CouchDB .

+4

All Articles