incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Cottlehuber <d...@muse.net.nz>
Subject Re: view that gets all entries between start and end date that are different variables
Date Tue, 07 Jun 2011 07:04:43 GMT
On 7 June 2011 16:34, Jacob Fenwick <jacob.fenwick@gmail.com> 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

Mime
View raw message