You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ro...@apache.org on 2015/02/03 16:13:14 UTC
[07/50] [abbrv] couchdb-mango git commit: Remove hardcoded w=3 for
design doc updates
Remove hardcoded w=3 for design doc updates
This was left over from testing. Probably best to remove it for
production.
Project: http://git-wip-us.apache.org/repos/asf/couchdb-mango/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mango/commit/116227c5
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mango/tree/116227c5
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mango/diff/116227c5
Branch: refs/heads/master
Commit: 116227c5b3a41fd38e3642312c02bc8840921403
Parents: bbac0d2
Author: Paul J. Davis <pa...@gmail.com>
Authored: Tue Jun 24 15:30:33 2014 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Tue Jun 24 15:30:33 2014 -0500
----------------------------------------------------------------------
src/mango_httpd.erl | 4 ++--
src/mango_opts.erl | 6 ++++++
2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/116227c5/src/mango_httpd.erl
----------------------------------------------------------------------
diff --git a/src/mango_httpd.erl b/src/mango_httpd.erl
index 36ebd91..68bced0 100644
--- a/src/mango_httpd.erl
+++ b/src/mango_httpd.erl
@@ -49,7 +49,7 @@ handle_index_req(#httpd{method='POST', path_parts=[_, _]}=Req, Db) ->
{ok, DDoc} ->
<<"exists">>;
{ok, NewDDoc} ->
- case mango_crud:insert(Db, NewDDoc, [{w, "3"} | Opts]) of
+ case mango_crud:insert(Db, NewDDoc, Opts) of
{ok, [{RespProps}]} ->
case lists:keyfind(error, 1, RespProps) of
{error, Reason} ->
@@ -91,7 +91,7 @@ handle_index_req(#httpd{method='DELETE',
_ ->
NewDDoc
end,
- case mango_crud:insert(Db, FinalDDoc, [{w, "3"}]) of
+ case mango_crud:insert(Db, FinalDDoc, []) of
{ok, _} ->
chttpd:send_json(Req, {[{ok, true}]});
_ ->
http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/116227c5/src/mango_opts.erl
----------------------------------------------------------------------
diff --git a/src/mango_opts.erl b/src/mango_opts.erl
index 44426db..9affbd0 100644
--- a/src/mango_opts.erl
+++ b/src/mango_opts.erl
@@ -46,6 +46,12 @@ validate_idx_create({Props}) ->
{optional, true},
{default, auto_name},
{validator, fun validate_idx_name/1}
+ ]},
+ {<<"w">>, [
+ {tag, w},
+ {optional, true},
+ {default, 2},
+ {validator, fun is_non_neg_integer/1}
]}
],
validate(Props, Opts).