Norman, > I have written some code to query a view within Erlang and it seems > too simple :-) Welcome to CouchDB. Simple is the implementation corollary of Relax. :) > Am I really just looping through a view and returning > {ok, State} if a key matches a particular input KeyId and calling > {stop, State} when I want the iteration to stop? > > I appreciate there is an index behind the view which makes things > fast, but the looping seems really simple.  Verification of this > approach would be very much appreciated as I go forward! Even in advanced algorithms indexes are basically just sorted lists at the core. Couch's view interface makes that pretty plain. So yes, you can just iterate over the views as you see fit. The key to why this is quick and delicious is that seeking to the start of iteration (when you provide a startkey) is that you only do a log(N) seek to the first key. HTH, Paul Davis