anchor.diff:          #{expiry := _} ->
               Ctx;
           #{sync_enabled := true} ->
  -            couchbase_driver:set_expiry(Ctx, application:get_env(?CLUSTER_WORKER_APP_NAME, document_expiry, ?EXPIRY));
  +            set_expiry(Ctx, application:get_env(?CLUSTER_WORKER_APP_NAME, document_expiry, ?EXPIRY));
           _ ->
  -            couchbase_driver:set_expiry(Ctx, 1)
  +            set_expiry(Ctx, 1)
       end,
       Result = datastore_apply(CtxWithExpiry, Key, fun datastore:delete/3, delete, [Pred]),
       delete_all_links(Ctx, Key, Result),
  
positive.code:         _ ->
              {Ctx, atom_to_binary(Model, utf8)}
      end.
  
  %%%===================================================================
  %%% Internal functions
  
negative.code: -export([fold_links/6]).
  -export([get_links_trees/2]).
  -export([fold_memory_keys/2]).
  -export([set_expiry/2]).
  %% for rpc
  -export([datastore_apply_all_subtrees/4]).
  
  