benoitc/couchbeam — Issue #64: startkey, endkey parameters aren't working
Author: denisok
Created: 2011-12-27 22:02:12+00:00
State: open

query:
Options = [{startkey, [Date, list_to_bitstring(Branch)]},
{endkey, [Date, list_to_bitstring(Branch), {[]}]}],
DesignName = "vetting",
ViewName = "tests_groups",
{ok, _ViewResults} = couchbeam_view:fetch(Db, {DesignName, ViewName}, Options).

Isn't working correctly.

That is because couchbeam_view.erl parsing startkey/endkeys atoms as:
parse_view_options([{start_key, Value}|Rest], #view_query_args{options=Opts}=Args) ->
Opts1 = [{"start_key", Value}|Opts],
parse_view_options(Rest, Args#view_query_args{options=Opts1});
parse_view_options([{end_key, Value}|Rest], #view_query_args{options=Opts}=Args) ->
Opts1 = [{"end_key", Value}|Opts],

but according to http://wiki.apache.org/couchdb/HTTP_view_API, this parameters should be named as "startkey" and "endkey".