Browse files

changed Object Metadata -> Custom Metadata

  • Loading branch information...
1 parent f3d7d22 commit 8b54d52200d0d010bd60d96a4c0a7427cdc7214e Dave Parfitt committed Oct 22, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2
@@ -282,7 +282,7 @@ Here's an example of getting/setting properties
-Object Metadata
+Custom Metadata
Object metadata can be manipulated by using the `update_metadata/2`, `get_metadata/1` and `get_update_metadata/1` functions.
@@ -292,12 +292,13 @@ Object metadata can be manipulated by using the `update_metadata/2`, `get_metada
The following example illustrates setting and getting metadata.
Object = riakc_obj:new(<<"groceries">>, <<"mine">>, <<"eggs & bacon">>).
- MetaData = dict:from_list([{<<"X-Riak-Meta">>, [{"Foo", "Bar"}]}]),
+ MetaData = dict:from_list([{<<"X-Riak-Meta">>, [{"Foo", "Bar"}]}]), %% see comment below
Object2 = riakc_obj:update_metadata(Object, MetaData).
riakc_pb_socket:put(Pid, Object2).
{ok, O} = riakc_pb_socket:get(Pid, <<"groceries">>, <<"mine">>).
{ok, MD} = dict:find(<<"X-Riak-Meta">>, riakc_obj:get_metadata(O)).
+* **Note**: In this example, creating a new metadata dict will blow away any content-type or other metadata that was set previously.

0 comments on commit 8b54d52

Please sign in to comment.