couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt King <>
Subject How Views Work
Date Fri, 07 Aug 2009 17:35:17 GMT
Hi all,

I have question about how views work. I read that when you create a  
view, CouchDB indexes it so it's faster on the next request. But if I  
pass in startkey and endkey, does it only index the docs that are  
returned? Or is the entire list indexed and CouchDB returns the  
offsets as requested?

What I'm doing is querying a database and emitting a geo calculation  
of miles from a center point, then passing in startkey and endkey to  
only show results in a certain range.

e.g. http://hostname/locations/_design/search/_view/[view_name]? 


0.63269276577514,"value":"Location Name"},
0.6677870430738252,"value":"Another Location Name"}

Where key is the distance from the origin, and value is the name of  
the location.

My thought is to generate a new view for each new center point  
requested, but if each view will store whole list, that seems  


View raw message