anchor.diff:  
   %%--------------------------------------------------------------------
   %% @doc
  +%% @equiv save_view_doc(Ctx, ViewName, Function, []).
  +%% @end
  +%%--------------------------------------------------------------------
  +-spec save_view_doc(ctx(), view(), binary()) -> ok | {error, term()}.
  +save_view_doc(Ctx, ViewName, Function) ->
  +    save_view_doc(Ctx, ViewName, Function, []).
  +
  +%%--------------------------------------------------------------------
  +%% @doc
   %% Creates a design document with a single view. Name of design document is
   %% equal to the view name.
   %% @end
   %%--------------------------------------------------------------------
  --spec save_view_doc(ctx(), view(), binary()) -> ok | {error, term()}.
  -save_view_doc(Ctx, ViewName, Function) ->
  -    EJson = {[{<<"views">>, {[{
  -        ViewName, {[{
  -            <<"map">>, Function
  -        }]}
  -    }]}}]},
  +-spec save_view_doc(ctx(), view(), binary(), view_creation_opts()) -> ok | {error, term()}.
  +save_view_doc(Ctx, ViewName, Function, Opts) ->
  +    EJson = {[
  +        {<<"views">>, {[
  +            {ViewName, {[
  +                {<<"map">>, Function}
  +            ]}}
  +        ]}},
  +        {<<"options">>, {[
  +            {<<"updateMinChanges">>, proplists:get_value(update_min_changes, Opts, ?UPDATE_MIN_CHANGES)},
  +            {<<"replicaUpdateMinChanges">>, proplists:get_value(replica_update_min_changes, Opts, ?REPLICA_UPDATE_MIN_CHANGES)}
  +        ]}}
  +    ]},
       save_design_doc(Ctx, ViewName, EJson).
  +
  +%%--------------------------------------------------------------------
  +%% @doc
  +%% @equiv save_spatial_view_doc(Ctx, ViewName, Function, []).
  +%% @end
  +%%--------------------------------------------------------------------
  +-spec save_spatial_view_doc(ctx(), view(), binary()) -> ok | {error, term()}.
  +save_spatial_view_doc(Ctx, ViewName, Function) ->
  +    save_spatial_view_doc(Ctx, ViewName, Function, []).
   
   %%--------------------------------------------------------------------
   %% @doc
  
positive.code: -type item() :: {ctx(), key(), value()}.
  -type design() :: binary().
  -type view() :: binary().
  -type view_opt() :: {descending, boolean()} |
                      {endkey, binary()} |
                      {endkey_docid, binary()} |
  
negative.code: %% is equal to the view name.
  %% @end
  %%--------------------------------------------------------------------
  -spec save_spatial_view_doc(ctx(), view(), binary(), view_creation_opts()) -> ok | {error, term()}.
  save_spatial_view_doc(Ctx, ViewName, Function, Opts) ->
      EJson = {[
          {<<"spatial">>, {[
              {ViewName, Function}
          ]}},
          {<<"options">>, {[
              {<<"updateMinChanges">>, proplists:get_value(update_min_changes, Opts, ?UPDATE_MIN_CHANGES)},
              {<<"replicaUpdateMinChanges">>, proplists:get_value(replica_update_min_changes, Opts, ?REPLICA_UPDATE_MIN_CHANGES)}
          ]}}
      ]},
      save_design_doc(Ctx, ViewName, EJson).
  
  %%--------------------------------------------------------------------
  