anchor.diff:  %% @end
   %%--------------------------------------------------------------------
   -spec doc({change, term()}) -> term().
  -doc({change,{Props}}) ->
  +doc({change, {Props}}) ->
       {_, Doc} = lists:keyfind(<<"doc">>, 1, Props),
       Doc.
   
  
positive.code:                 State;
              {PortFD, closed} ->
                  State#{status => closed};
              {'EXIT', PortFD, Reason} ->
                  ?error("CouchBase gateway's port ~p exited with reason: ~p", [State, Reason]),
                  State#{status => failed};
  
negative.code:     gateway_loop(State).
  
  
  %%--------------------------------------------------------------------
  %% @doc
  %% Loop for managing Erlang Port (couchbase-sync-gateway).
  %% @end
  %%--------------------------------------------------------------------
  -spec gateway_loop(State :: #{atom() => term()}) -> no_return().
  gateway_loop(#{port_fd := PortFD, id := {_, N} = ID, db_hostname := Hostname, db_port := Port, start_time := ST} = State) ->
      try port_command(PortFD, <<"ping">>) of
          true -> ok
      catch
  