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 2016/12/06 20:54:36 UTC

[1/8] couchdb-mango git commit: Set default limit to 25

Repository: couchdb-mango
Updated Branches:
  refs/heads/upstream 1a4215678 -> 4afd60e84


Set default limit to 25

The docs claim the limit is 25 and this was the intention but this value
was never updated. The reason to set it at 25 is in case we add other
index types that are unable to stream results to the client (ie,
anything Lucene based). This allows us to maintain the same API across
all calls regardless of index type used.

COUCHDB-3143


Project: http://git-wip-us.apache.org/repos/asf/couchdb-mango/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mango/commit/d8432c58
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mango/tree/d8432c58
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mango/diff/d8432c58

Branch: refs/heads/upstream
Commit: d8432c58a004141123e13a5af6dad78e3746399d
Parents: 1a42156
Author: Paul J. Davis <pa...@gmail.com>
Authored: Sun Sep 11 13:38:12 2016 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Sun Sep 11 14:07:50 2016 -0500

----------------------------------------------------------------------
 src/mango_cursor.hrl | 2 +-
 src/mango_opts.erl   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/d8432c58/src/mango_cursor.hrl
----------------------------------------------------------------------
diff --git a/src/mango_cursor.hrl b/src/mango_cursor.hrl
index f80c987..5706b6b 100644
--- a/src/mango_cursor.hrl
+++ b/src/mango_cursor.hrl
@@ -16,7 +16,7 @@
     ranges,
     selector,
     opts,
-    limit = 10000000000,
+    limit = 25,
     skip = 0,
     fields = undefined,
     user_fun,

http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/d8432c58/src/mango_opts.erl
----------------------------------------------------------------------
diff --git a/src/mango_opts.erl b/src/mango_opts.erl
index 0c66a21..40e3504 100644
--- a/src/mango_opts.erl
+++ b/src/mango_opts.erl
@@ -93,7 +93,7 @@ validate_find({Props}) ->
         {<<"limit">>, [
             {tag, limit},
             {optional, true},
-            {default, 10000000000},
+            {default, 25},
             {validator, fun is_non_neg_integer/1}
         ]},
         {<<"skip">>, [


[6/8] couchdb-mango git commit: Tiny improvements for test README

Posted by to...@apache.org.
Tiny improvements for test README


Project: http://git-wip-us.apache.org/repos/asf/couchdb-mango/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mango/commit/d8792e40
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mango/tree/d8792e40
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mango/diff/d8792e40

Branch: refs/heads/upstream
Commit: d8792e40ffabf0581ce48600abcf286f57c2dfd6
Parents: 30b3696
Author: katsel <ka...@users.noreply.github.com>
Authored: Tue Oct 11 12:41:27 2016 +0200
Committer: Nick Vatamaniuc <va...@apache.org>
Committed: Wed Nov 30 12:40:43 2016 -0500

----------------------------------------------------------------------
 test/README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/d8792e40/test/README.md
----------------------------------------------------------------------
diff --git a/test/README.md b/test/README.md
index ed9e0fc..fc2cd62 100644
--- a/test/README.md
+++ b/test/README.md
@@ -1,9 +1,9 @@
 Mango Tests
 ===========
 
-CouchDB should be started with ./dev/run -a testuser:testpass.
+CouchDB should be started with `./dev/run -a testuser:testpass`.
 
-To run these, do this in the top level directory:
+To run these, do this in the Mango top level directory:
 
     $ virtualenv venv
     $ source venv/bin/activate


[4/8] couchdb-mango git commit: Configurable default limit

Posted by to...@apache.org.
Configurable default limit


Project: http://git-wip-us.apache.org/repos/asf/couchdb-mango/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mango/commit/ddd6a4d4
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mango/tree/ddd6a4d4
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mango/diff/ddd6a4d4

Branch: refs/heads/upstream
Commit: ddd6a4d44019975efe660203859e67211da1d255
Parents: 610ccb6
Author: Robert Newson <rn...@apache.org>
Authored: Fri Sep 30 12:40:31 2016 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Fri Sep 30 12:40:51 2016 +0100

----------------------------------------------------------------------
 src/mango_cursor.hrl         | 4 ++--
 src/mango_cursor_special.erl | 2 +-
 src/mango_cursor_text.erl    | 2 +-
 src/mango_cursor_view.erl    | 2 +-
 src/mango_opts.erl           | 8 ++++++--
 5 files changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/ddd6a4d4/src/mango_cursor.hrl
----------------------------------------------------------------------
diff --git a/src/mango_cursor.hrl b/src/mango_cursor.hrl
index 5706b6b..58782e5 100644
--- a/src/mango_cursor.hrl
+++ b/src/mango_cursor.hrl
@@ -16,9 +16,9 @@
     ranges,
     selector,
     opts,
-    limit = 25,
+    limit,
     skip = 0,
     fields = undefined,
     user_fun,
     user_acc
-}).
\ No newline at end of file
+}).

http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/ddd6a4d4/src/mango_cursor_special.erl
----------------------------------------------------------------------
diff --git a/src/mango_cursor_special.erl b/src/mango_cursor_special.erl
index 6058217..8404bc0 100644
--- a/src/mango_cursor_special.erl
+++ b/src/mango_cursor_special.erl
@@ -35,7 +35,7 @@ create(Db, Indexes, Selector, Opts) ->
     Composited = mango_cursor_view:composite_indexes(Indexes, FieldRanges),
     {Index, IndexRanges} = mango_cursor_view:choose_best_index(Db, Composited),
 
-    Limit = couch_util:get_value(limit, Opts, 10000000000),
+    Limit = couch_util:get_value(limit, Opts, mango_opts:default_limit()),
     Skip = couch_util:get_value(skip, Opts, 0),
     Fields = couch_util:get_value(fields, Opts, all_fields),
 

http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/ddd6a4d4/src/mango_cursor_text.erl
----------------------------------------------------------------------
diff --git a/src/mango_cursor_text.erl b/src/mango_cursor_text.erl
index 920f6f7..a094b55 100644
--- a/src/mango_cursor_text.erl
+++ b/src/mango_cursor_text.erl
@@ -51,7 +51,7 @@ create(Db, Indexes, Selector, Opts0) ->
     Opts = unpack_bookmark(Db#db.name, Opts0),
 
     DreyfusLimit = get_dreyfus_limit(),
-    Limit = erlang:min(DreyfusLimit, couch_util:get_value(limit, Opts, 50)),
+    Limit = erlang:min(DreyfusLimit, couch_util:get_value(limit, Opts, mango_opts:default_limit())),
     Skip = couch_util:get_value(skip, Opts, 0),
     Fields = couch_util:get_value(fields, Opts, all_fields),
 

http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/ddd6a4d4/src/mango_cursor_view.erl
----------------------------------------------------------------------
diff --git a/src/mango_cursor_view.erl b/src/mango_cursor_view.erl
index 5f109cd..302acd3 100644
--- a/src/mango_cursor_view.erl
+++ b/src/mango_cursor_view.erl
@@ -35,7 +35,7 @@ create(Db, Indexes, Selector, Opts) ->
     Composited = composite_indexes(Indexes, FieldRanges),
     {Index, IndexRanges} = choose_best_index(Db, Composited),
 
-    Limit = couch_util:get_value(limit, Opts, 10000000000),
+    Limit = couch_util:get_value(limit, Opts, mango_opts:default_limit()),
     Skip = couch_util:get_value(skip, Opts, 0),
     Fields = couch_util:get_value(fields, Opts, all_fields),
 

http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/ddd6a4d4/src/mango_opts.erl
----------------------------------------------------------------------
diff --git a/src/mango_opts.erl b/src/mango_opts.erl
index 40e3504..af318d2 100644
--- a/src/mango_opts.erl
+++ b/src/mango_opts.erl
@@ -32,7 +32,9 @@
     validate_bookmark/1,
     validate_sort/1,
     validate_fields/1,
-    validate_bulk_delete/1
+    validate_bulk_delete/1,
+
+    default_limit/0
 ]).
 
 
@@ -93,7 +95,7 @@ validate_find({Props}) ->
         {<<"limit">>, [
             {tag, limit},
             {optional, true},
-            {default, 25},
+            {default, default_limit()},
             {validator, fun is_non_neg_integer/1}
         ]},
         {<<"skip">>, [
@@ -308,3 +310,5 @@ validate_opt(Name, [{validator, Fun} | Rest], Value) ->
     end.
 
 
+default_limit() ->
+    config:get_integer("mango", "default_limit", 25).


[2/8] couchdb-mango git commit: Fix test suite check for text indexes

Posted by to...@apache.org.
Fix test suite check for text indexes

This was passing by accident on travis because the $CWD is set
differently so the test would always fail. If however you tried to run
the tests locally then it would fail. Obviously the test is just wrong
since we're moving the mango_cursor_text.erl file in rebar.config, and
not mango_cursor.erl which is required for every index type.

COUCHDB-3143


Project: http://git-wip-us.apache.org/repos/asf/couchdb-mango/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mango/commit/29b59449
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mango/tree/29b59449
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mango/diff/29b59449

Branch: refs/heads/upstream
Commit: 29b59449dffea83470ec5c828a8ab2e8c6504a65
Parents: d8432c5
Author: Paul J. Davis <pa...@gmail.com>
Authored: Sun Sep 11 14:08:51 2016 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Sun Sep 11 14:08:51 2016 -0500

----------------------------------------------------------------------
 test/mango.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/29b59449/test/mango.py
----------------------------------------------------------------------
diff --git a/test/mango.py b/test/mango.py
index 09c45fc..da51180 100644
--- a/test/mango.py
+++ b/test/mango.py
@@ -27,7 +27,7 @@ def random_db_name():
     return "mango_test_" + uuid.uuid4().hex
 
 def has_text_service():
-    return os.path.isfile(os.getcwd() + "/../src/mango_cursor.erl")
+    return os.path.isfile(os.getcwd() + "/../src/mango_cursor_text.erl")
 
 
 class Database(object):


[8/8] couchdb-mango git commit: Add config parameter to reject index all text indexes

Posted by to...@apache.org.
Add config parameter to reject index all text indexes

Text indexes that index all fields can sometimes lead to OOM issues
when users have documents with nested array fields. This change adds
in a config parameter to provide the ability to log users who do this
and also reject new requests. Note that we need to pass in a db
record to validate_new because it contains user and db name info that
will be logged.

COUCHDB-3249


Project: http://git-wip-us.apache.org/repos/asf/couchdb-mango/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mango/commit/4afd60e8
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mango/tree/4afd60e8
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mango/diff/4afd60e8

Branch: refs/heads/upstream
Commit: 4afd60e84d0e1c57f5d6a1e3542955faa565ca4b
Parents: 50066bc
Author: Tony Sun <to...@cloudant.com>
Authored: Tue Dec 6 00:46:51 2016 -0800
Committer: Tony Sun <to...@cloudant.com>
Committed: Tue Dec 6 12:59:55 2016 -0800

----------------------------------------------------------------------
 src/mango_error.erl    |  6 ++++
 src/mango_httpd.erl    |  2 +-
 src/mango_idx.erl      |  6 ++--
 src/mango_idx_text.erl | 83 +++++++++++++++++++++++++++++++++++++++++++--
 src/mango_idx_view.erl |  4 +--
 5 files changed, 93 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/4afd60e8/src/mango_error.erl
----------------------------------------------------------------------
diff --git a/src/mango_error.erl b/src/mango_error.erl
index f0a8ee2..76a8362 100644
--- a/src/mango_error.erl
+++ b/src/mango_error.erl
@@ -174,6 +174,12 @@ info(mango_idx_text, {index_not_found, BadIdx}) ->
         <<"index_not_found">>,
         fmt("Text index ~s not found in this design doc.", [BadIdx])
     };
+info(mango_idx_text, index_all_disabled) ->
+    {
+        403,
+        <<"index_all_disabled">>,
+        <<"New text indexes are forbidden to index all fields.">>
+    };
 
 info(mango_opts, {invalid_bulk_docs, Val}) ->
     {

http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/4afd60e8/src/mango_httpd.erl
----------------------------------------------------------------------
diff --git a/src/mango_httpd.erl b/src/mango_httpd.erl
index bde3850..a088276 100644
--- a/src/mango_httpd.erl
+++ b/src/mango_httpd.erl
@@ -84,7 +84,7 @@ handle_index_req(#httpd{method='POST', path_parts=[_, _]}=Req, Db) ->
     chttpd:validate_ctype(Req, "application/json"),
     {ok, Opts} = mango_opts:validate_idx_create(chttpd:json_body_obj(Req)),
     {ok, Idx0} = mango_idx:new(Db, Opts),
-    {ok, Idx} = mango_idx:validate_new(Idx0),
+    {ok, Idx} = mango_idx:validate_new(Idx0, Db),
     {ok, DDoc} = mango_util:load_ddoc(Db, mango_idx:ddoc(Idx)),
     Id = Idx#idx.ddoc,
     Name = Idx#idx.name,

http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/4afd60e8/src/mango_idx.erl
----------------------------------------------------------------------
diff --git a/src/mango_idx.erl b/src/mango_idx.erl
index 11c713b..bc88b97 100644
--- a/src/mango_idx.erl
+++ b/src/mango_idx.erl
@@ -23,7 +23,7 @@
     for_sort/2,
 
     new/2,
-    validate_new/1,
+    validate_new/2,
     add/2,
     remove/2,
     from_ddoc/2,
@@ -136,9 +136,9 @@ new(Db, Opts) ->
     }}.
 
 
-validate_new(Idx) ->
+validate_new(Idx, Db) ->
     Mod = idx_mod(Idx),
-    Mod:validate_new(Idx).
+    Mod:validate_new(Idx, Db).
 
 
 add(DDoc, Idx) ->

http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/4afd60e8/src/mango_idx_text.erl
----------------------------------------------------------------------
diff --git a/src/mango_idx_text.erl b/src/mango_idx_text.erl
index 40a1fd3..4cfda5a 100644
--- a/src/mango_idx_text.erl
+++ b/src/mango_idx_text.erl
@@ -14,7 +14,7 @@
 
 
 -export([
-    validate_new/1,
+    validate_new/2,
     validate_fields/1,
     validate_index_def/1,
     add/2,
@@ -32,8 +32,9 @@
 -include("mango_idx.hrl").
 
 
-validate_new(#idx{}=Idx) ->
+validate_new(#idx{}=Idx, Db) ->
     {ok, Def} = do_validate(Idx#idx.def),
+    maybe_reject_index_all_req(Def, Db),
     {ok, Idx#idx{def=Def}}.
 
 
@@ -327,3 +328,81 @@ indexable_fields(Fields, {op_null, {_, _}}) ->
 
 indexable_fields(Fields, {op_default, _}) ->
     [<<"$default">> | Fields].
+
+
+maybe_reject_index_all_req({Def}, #db{name=DbName, user_ctx=Ctx}) ->
+    User = Ctx#user_ctx.name,
+    Fields = couch_util:get_value(fields, Def),
+    case {Fields, forbid_index_all()} of
+        {all_fields, "true"} ->
+            ?MANGO_ERROR(index_all_disabled);
+        {all_fields, "warn"} ->
+            couch_log:warning("User ~p is indexing all fields in db ~p",
+                [User, DbName]);
+        _ ->
+            ok
+    end.
+
+
+forbid_index_all() ->
+    config:get("mango", "index_all_disabled", "false").
+
+
+-ifdef(TEST).
+-include_lib("eunit/include/eunit.hrl").
+
+
+setup() ->
+    test_util:start_couch(),
+    meck:expect(couch_log, warning, 2,
+        fun(_,_) ->
+            throw({test_error, logged_warning})
+        end),
+    %default index all def that generates {fields, all_fields}
+    Index = #idx{def={[]}},
+    Db = #db{name = <<"testdb">>, user_ctx=#user_ctx{name = <<"u1">>}},
+    {Index, Db}.
+
+
+teardown(_) ->
+    ok = config:delete("mango", "index_all_disabled"),
+    test_util:stop_couch().
+
+
+index_all_test_() ->
+    {
+        foreach,
+        fun setup/0,
+        fun teardown/1,
+        [
+            fun forbid_index_all/1,
+            fun default_and_false_index_all/1,
+            fun warn_index_all/1
+        ]
+
+    }.
+
+
+forbid_index_all({Idx, Db}) ->
+    ok = config:set("mango", "index_all_disabled", "true"),
+    ?_assertThrow({mango_error, ?MODULE, index_all_disabled},
+        validate_new(Idx, Db)
+    ).
+
+
+default_and_false_index_all({Idx, Db}) ->
+    {ok, #idx{def={Def}}} = validate_new(Idx, Db),
+    Fields = couch_util:get_value(fields, Def),
+    ?_assertEqual(all_fields, Fields),
+    ok = config:set("mango", "index_all_disabled", "false"),
+    {ok, #idx{def={Def2}}} = validate_new(Idx, Db),
+    Fields2 = couch_util:get_value(fields, Def2),
+    ?_assertEqual(all_fields, Fields2).
+
+
+warn_index_all({Idx, Db}) ->
+    ok = config:set("mango", "index_all_disabled", "warn"),
+    ?_assertThrow({test_error, logged_warning}, validate_new(Idx, Db)).
+
+
+-endif.

http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/4afd60e8/src/mango_idx_view.erl
----------------------------------------------------------------------
diff --git a/src/mango_idx_view.erl b/src/mango_idx_view.erl
index 0cc713f..8bad34c 100644
--- a/src/mango_idx_view.erl
+++ b/src/mango_idx_view.erl
@@ -14,7 +14,7 @@
 
 
 -export([
-    validate_new/1,
+    validate_new/2,
     validate_index_def/1,
     add/2,
     remove/2,
@@ -36,7 +36,7 @@
 -include("mango_idx.hrl").
 
 
-validate_new(#idx{}=Idx) ->
+validate_new(#idx{}=Idx, _Db) ->
     {ok, Def} = do_validate(Idx#idx.def),
     {ok, Idx#idx{def=Def}}.
 


[7/8] couchdb-mango git commit: Add .rebar/ to gitignore

Posted by to...@apache.org.
Add .rebar/ to gitignore


Project: http://git-wip-us.apache.org/repos/asf/couchdb-mango/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mango/commit/50066bc8
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mango/tree/50066bc8
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mango/diff/50066bc8

Branch: refs/heads/upstream
Commit: 50066bc841be578fc1cc2ed8f404392c71d853e5
Parents: d8792e4
Author: katsel <ka...@users.noreply.github.com>
Authored: Tue Oct 11 12:41:45 2016 +0200
Committer: Nick Vatamaniuc <va...@apache.org>
Committed: Wed Nov 30 12:40:43 2016 -0500

----------------------------------------------------------------------
 .gitignore | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/50066bc8/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 50d43d8..4469453 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+.rebar/
 ebin/
 test/*.pyc
 venv/


[3/8] couchdb-mango git commit: Merge remote-tracking branch 'cloudant/3143-fix-default-limit'

Posted by to...@apache.org.
Merge remote-tracking branch 'cloudant/3143-fix-default-limit'

* cloudant/3143-fix-default-limit:
  Fix test suite check for text indexes
  Set default limit to 25


Project: http://git-wip-us.apache.org/repos/asf/couchdb-mango/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mango/commit/610ccb60
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mango/tree/610ccb60
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mango/diff/610ccb60

Branch: refs/heads/upstream
Commit: 610ccb60d09bb2a730fa1af318c6ce558538d2ba
Parents: 1a42156 29b5944
Author: Jan Lehnardt <ja...@apache.org>
Authored: Mon Sep 12 08:13:29 2016 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 12 08:13:29 2016 +0200

----------------------------------------------------------------------
 src/mango_cursor.hrl | 2 +-
 src/mango_opts.erl   | 2 +-
 test/mango.py        | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------



[5/8] couchdb-mango git commit: remove docs for missing_is_null as the feature was removed

Posted by to...@apache.org.
remove docs for missing_is_null as the feature was removed


Project: http://git-wip-us.apache.org/repos/asf/couchdb-mango/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mango/commit/30b3696b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mango/tree/30b3696b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mango/diff/30b3696b

Branch: refs/heads/upstream
Commit: 30b3696b876533a8321b702be43ae9bbca125040
Parents: ddd6a4d
Author: Robert Newson <rn...@apache.org>
Authored: Wed Oct 19 12:21:13 2016 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Wed Oct 19 12:21:13 2016 +0100

----------------------------------------------------------------------
 README.md | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/30b3696b/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 382681f..e9d4a66 100644
--- a/README.md
+++ b/README.md
@@ -140,7 +140,6 @@ Keys:
 
 * action - "create\_index"
 * index - JSON array following sort syntax, described below
-* missing\_is\_null (optional) (default: false) - When indexing documents that do not contain a field required by the index they are usually ignored for the purpose of that index, using `missing\_is\_null` adds an entry to the index for the document with a value of `null`
 * type (optional) (default: "json") - string, specifying the index type to create. Currently only "json" indexes are supported but in the future we will provide full-text indexes as well as Geo spatial indexes
 * name (optional) - string, optionally specify a name for the index. If a name is not provided one will be automatically generated
 * ddoc (optional) - Indexes can be grouped into design documents underneath the hood for efficiency. This is an advanced feature. Don't specify a design document here unless you know the consequences of index invalidation. By default each index is placed in its own separate design document for isolation.