diff options
author | John Christopher Anderson <jchris@apache.org> | 2009-02-25 06:34:03 +0000 |
---|---|---|
committer | John Christopher Anderson <jchris@apache.org> | 2009-02-25 06:34:03 +0000 |
commit | 0fb2f9696d8005eb46d5efeac1ae217fe0fb6a04 (patch) | |
tree | 5ebb4d9ff7ef8e4bf2c61b84ecd11ae272c9e420 /src/couchdb/couch_query_servers.erl | |
parent | 1ba7a12c72cfb645c36187bbb95ea9160c8a3284 (diff) |
Support for reduce views in _list. closes COUCHDB-260. Thanks Jason Davies.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@747679 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_query_servers.erl')
-rw-r--r-- | src/couchdb/couch_query_servers.erl | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/couchdb/couch_query_servers.erl b/src/couchdb/couch_query_servers.erl index 5eca63c2..a33ffada 100644 --- a/src/couchdb/couch_query_servers.erl +++ b/src/couchdb/couch_query_servers.erl @@ -18,7 +18,7 @@ -export([init/1, terminate/2, handle_call/3, handle_cast/2, handle_info/2,code_change/3,stop/0]). -export([start_doc_map/2, map_docs/2, stop_doc_map/1]). -export([reduce/3, rereduce/3,validate_doc_update/5]). --export([render_doc_show/5,start_view_list/2,render_list_head/5, render_list_row/4, render_list_tail/3]). +-export([render_doc_show/5,start_view_list/2,render_list_head/5, render_list_row/4, render_list_tail/3, render_reduce_head/3, render_reduce_row/4]). % -export([test/0]). -include("couch_db.hrl"). @@ -160,6 +160,16 @@ render_list_tail({Lang, Pid}, Req, Db) -> JsonResp. +render_reduce_head({_Lang, Pid}, Req, Db) -> + Head = {[]}, + JsonReq = couch_httpd_external:json_req_obj(Req, Db), + couch_os_process:prompt(Pid, [<<"list_begin">>, Head, JsonReq]). + +render_reduce_row({_Lang, Pid}, Req, Db, {Key, Value}) -> + JsonRow = {[{key, Key}, {value, Value}]}, + JsonReq = couch_httpd_external:json_req_obj(Req, Db), + couch_os_process:prompt(Pid, [<<"list_row">>, JsonRow, JsonReq]). + init([]) -> |