On 7 June 2011 16:34, Jacob Fenwick <[email protected]> wrote: > I want something that reproduces this SQL query in couchdb: > SELECT * WHERE [start timestamp] >= doc.start AND [end timestamp] < doc.end; > > I know this has probably been asked many times before. > > In fact, here's someone asking it on StackOverflow: > http://stackoverflow.com/questions/3216868/querying-couchdb-documents-between-a-start-date-and-an-end-date > > Supposedly this is an answer but I've tried it and it doesn't seem to work: > http://stackoverflow.com/questions/3079040/range-keys-in-couchdb-views > > Is this just not possible in couchdb without something like couchdb-lucene?
If you want intersection of set A and set B, you'll need to either do it client side, or use lucene (for when you need both Foo AND Bar)... Heres a good client-side example - using reduce to minimise the # of records retrieved - and for bonus points a segueway into lucene at the end. http://web.archiveorange.com/archive/v/oW6Dz0nkuOQqZ88vPMmR A+ Dave
