You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by to...@apache.org on 2020/06/12 18:13:40 UTC

[couchdb] 01/01: add back r and w options

This is an automated email from the ASF dual-hosted git repository.

tonysun83 pushed a commit to branch add-r-w-back
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 751a940f66822112cf93a7c47986d8a417d0c85f
Author: Tony Sun <to...@gmail.com>
AuthorDate: Fri Jun 12 11:02:48 2020 -0700

    add back r and w options
---
 src/mango/src/mango_opts.erl | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/mango/src/mango_opts.erl b/src/mango/src/mango_opts.erl
index e357676..7bae9c9 100644
--- a/src/mango/src/mango_opts.erl
+++ b/src/mango/src/mango_opts.erl
@@ -64,6 +64,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_pos_integer/1}
         ]}
     ],
     validate(Props, Opts).
@@ -111,6 +117,12 @@ validate_find({Props}) ->
             {default, []},
             {validator, fun validate_fields/1}
         ]},
+        {<<"r">>, [
+            {tag, r},
+            {optional, true},
+            {default, 1},
+            {validator, fun mango_opts:is_pos_integer/1}
+        ]},
         {<<"conflicts">>, [
             {tag, conflicts},
             {optional, true},