Skip to content

Instantly share code, notes, and snippets.

@zkessin
Created August 23, 2017 11:00
Show Gist options
  • Save zkessin/e8d6239b3f76ecc4a4a2ebf72d5f2975 to your computer and use it in GitHub Desktop.
Save zkessin/e8d6239b3f76ecc4a4a2ebf72d5f2975 to your computer and use it in GitHub Desktop.
failing example
new(DB) ->
StoreConfig = #{
name => DB
},
{ok ,_} = application:ensure_all_started(barrel),
{ok ,_} = application:ensure_all_started(es_store),
case es_store:new(StoreConfig) of
{ok,DBName} ->
DBName;
{error, {store_exists,StoreConfig}} ->
{ok, StoreConfig}
end.
post_prob() ->
{ok, _} = new(<<"251d1d2a-7008-40d6-a99c-a35a65cba0ca">>),
es_store:post( <<"251d1d2a-7008-40d6-a99c-a35a65cba0ca">>,
#{<<"id">> => <<"aaaaa">>,
<<"v">> => <<"AAAAA">>} ,
#{}).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment