New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow couchbeam_doc:extend/2 to merge 2 documents. #84

merged 1 commit into from Feb 28, 2013
Jump to file or symbol
Failed to load files and symbols.
+3 −1
Diff settings


Just for now

Allow couchbeam_doc:extend/2 to merge 2 documents.

  • Loading branch information...
JonGretar committed Jan 29, 2013
commit b45b3c9da986f1964431f2ac11321cc6ed53428f
@@ -81,9 +81,11 @@ extend(Key, Value, JsonObj) ->
%% @spec extend(Prop::property(), JsonObj::json_obj()) -> json_obj()
%% @type property() = json_obj() | tuple()
%% @doc extend a jsonobject by a property or list of property
%% @doc extend a jsonobject by a property, list of property or another jsonobject
extend([], JsonObj) ->
extend({List}, JsonObj) when is_list(List) ->
extend(List, JsonObj);
extend([Prop|R], JsonObj)->
NewObj = extend(Prop, JsonObj),
extend(R, NewObj);
ProTip! Use n and p to navigate between commits in a pull request.