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:28:19 GMT
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.

regds,
mano

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