couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manokaran K <manoka...@gmail.com>
Subject Re: Map function to find docs in time interval
Date Mon, 19 Apr 2010 11:43:27 GMT
On Mon, Apr 19, 2010 at 4:58 PM, Manokaran K <manokaran@gmail.com> wrote:

> Following will create a lot of rows but the key size would be small:
>
> from_time = x milliseconds
> till_time = y milliseconds
>
> for(var i=from_time; i<=till_time; i += 60000){ //for each visitor, a row
> for every minute he/she was inside.
>  emit(i, doc._id);
> }
>
> Then you can query with the time (in millisecs) as the key to get all
> visitors.
>


Sorry. Instead of key, you'll have to use startkey and endkey

regds,
mano

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message