Skip to content

Instantly share code, notes, and snippets.

@russelldb
Created November 8, 2013 18:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save russelldb/46153e2ab9d2b9206f63 to your computer and use it in GitHub Desktop.
Save russelldb/46153e2ab9d2b9206f63 to your computer and use it in GitHub Desktop.
Make me a sibling
2> {ok, Pid} = riakc_pb_socket:start_link("localhost", 8087).
{ok,<0.38.0>}
3> A = riakc_obj:new(<<"b">>, <<"k">>, <<"one">>).
{riakc_obj,<<"b">>,<<"k">>,undefined,[],undefined,<<"one">>}
4> riakc_pb_socket:put(Pid, A).
ok
5> B = riakc_obj:new(<<"b">>, <<"k">>, <<"two">>).
{riakc_obj,<<"b">>,<<"k">>,undefined,[],undefined,<<"two">>}
6> riakc_pb_socket:put(Pid, B).
ok
7> {ok, Obj} = riakc_pb_socket:get(Pid, <<"b">>, <<"k">>).
{ok,{riakc_obj,<<"b">>,<<"k">>,
<<107,206,97,96,96,96,204,96,202,5,82,28,202,156,255,126,
6,85,159,95,157,193,148,...>>,
[{{dict,2,16,16,8,80,48,
{[],[],[],[],[],[],[],[],[],[],[],[],...},
{{[],[],[],[],[],[],[],[],[],[],...}}},
<<"two">>},
{{dict,2,16,16,8,80,48,
{[],[],[],[],[],[],[],[],[],[],[],...},
{{[],[],[],[],[],[],[],[],[],...}}},
<<"one">>}],
undefined,undefined}}
8> riakc_obj:get_values(Obj).
[<<"two">>,<<"one">>]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment