Repository: couchdb-fabric Updated Branches: refs/heads/master 244426bcf -> 9664463d9
Respect doc_options during _all_docs serialization When full documents are returned as part of an _all_docs response, respect doc_options (e.g. attachments=true) during JSON serialization. This closes #13 COUCHDB-2568 Signed-off-by: Alexander Shorin <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/commit/9664463d Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/tree/9664463d Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/diff/9664463d Branch: refs/heads/master Commit: 9664463d9b2b2dc11f1a28896eaee6b39ec5177f Parents: 244426b Author: Will Holley <[email protected]> Authored: Fri Feb 6 17:52:31 2015 +0000 Committer: Alexander Shorin <[email protected]> Committed: Wed Feb 11 13:23:30 2015 +0300 ---------------------------------------------------------------------- src/fabric_view_all_docs.erl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/9664463d/src/fabric_view_all_docs.erl ---------------------------------------------------------------------- diff --git a/src/fabric_view_all_docs.erl b/src/fabric_view_all_docs.erl index e7cc67c..034861f 100644 --- a/src/fabric_view_all_docs.erl +++ b/src/fabric_view_all_docs.erl @@ -54,13 +54,14 @@ go(DbName, Options, QueryArgs, Callback, Acc0) -> #mrargs{ direction = Dir, include_docs = IncludeDocs, + doc_options = Doc_Options, limit = Limit, skip = Skip, keys = Keys0 } = QueryArgs, {_, Ref0} = spawn_monitor(fun() -> exit(fabric:get_doc_count(DbName)) end), SpawnFun = fun(Key) -> - spawn_monitor(?MODULE, open_doc, [DbName, Options, Key, IncludeDocs]) + spawn_monitor(?MODULE, open_doc, [DbName, Doc_Options, Key, IncludeDocs]) end, MaxJobs = all_docs_concurrency(), Keys1 = case Dir of @@ -234,7 +235,7 @@ open_doc_int(DbName, Options, Id, IncludeDocs) -> Value = {[{rev,couch_doc:rev_to_str({RevPos, RevId})}, {deleted,true}]}, #view_row{key=Id, id=Id, value=Value}; {ok, #doc{revs=Revs} = Doc0} -> - Doc = couch_doc:to_json_obj(Doc0, []), + Doc = couch_doc:to_json_obj(Doc0, Options), {RevPos, [RevId|_]} = Revs, Value = {[{rev,couch_doc:rev_to_str({RevPos, RevId})}]}, #view_row{key=Id, id=Id, value=Value}
