incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill <bill.fos...@noteandgo.com>
Subject Multiple key value query
Date Thu, 29 Nov 2012 17:56:45 GMT
Hi,

I'm newer to couchdb and having some trouble figuring out how to do a query 
with multiple key values, including a date range. I have a map function like 
the following

function(doc) { 
  if(doc.type == "Article") { 
    emit([doc.location, doc.release_date], doc) 
  }
}

I'm wondering if it's possible to do a query similar to either of the following 
sql queries

select * from myView 
where location in ('MD', 'NY', 'VA') and 
release_date > '2012-11-01' and release_date < '2012-12-01'

OR

select * from myView 
where (location='MD' or location='NY' or location='VA') and
(release_date > '2012-11-01' and release_date < '2012-12-01')

Thanks for any help you can provide!

Bill


Mime
View raw message