Anonymous avatar Anonymous committed 62ae5f4

fix jiak_object examples in documentation to reflect binary bucket names

Comments (0)

Files changed (1)

src/jiak_object.erl

 %%      by mochijson2.  Thus, a simple object looks something like:
 %%```
 %%      {struct,
-%%       [{<<"bucket">>, foo},
+%%       [{<<"bucket">>, <<"foo">>},
 %%        {<<"key">>, <<"123">>},
 %%        {<<"object">>,
 %%         {struct,
 %%           {<<"bazField">>, 42},
 %%          ]}},
 %%        {<<"links">>,
-%%         [[quuxLink, <<"quuxKey">>, <<"quuxTag">>],
-%%          [abcLink, <<"abcKey">>, <<"abcTag">>]
+%%         [[<<"quuxLink">>, <<"quuxKey">>, <<"quuxTag">>],
+%%          [<<"abcLink">>, <<"abcKey">>, <<"abcTag">>]
 %%         ]},
 %%        {<<"vclock">>, <<"opaque-riak-vclock">>},
 %%        {<<"lastmod">>, <<"Mon, 03 Aug 2009 18:49:42 GMT">>}
 %%       <<"barValue">> = jiak_object:getp(O, <<"barField">>).
 %%       3 = jiak_object:getp(
 %%             jiak_object:setp(O, <<"bazField">>, 3)).
-%%       [[linkBucket, <<"linkKey">>, <<"linkTag">>]] =
-%%         jiak_object:links(O, linkBucket).
+%%       [[<<"linkBucket">>, <<"linkKey">>, <<"linkTag">>]] =
+%%         jiak_object:links(O, <<"linkBucket">>).
 %%'''
 %%       are all true.
 -module(jiak_object).
 %%            -> [{{atom(), binary()}, binary()}]
 %% @type link_tag() = term()|'_'
 %% @type link_bucket() = riak_object:bucket()|'_'
-%% @doc This function implements the map phase to which link map/reduce
-%%      specs are mapped.  The atom '_' means "match all", so for example,
-%%      {foo, '_'} would match all links to bucket 'foo' with any tag, while
-%%      {foo, bar} would match only links to bucket 'foo' with tag 'bar'.
-%%      The tags of the links will be included as the "KeyData" for the
-%%      bucket-key pair returned.
-%%      Keys that were inputs to this phase that reference non-existent
-%%      objects are ignored (i.e. {error,notfound} => []).
+%% @doc This function implements the map phase to which link
+%%      map/reduce specs are mapped.  The atom '_' means "match all",
+%%      so for example, {<<"foo">>, '_'} would match all links to
+%%      bucket 'foo' with any tag, while {<<"foo">>, <<"bar">>} would
+%%      match only links to bucket 'foo' with tag 'bar'.  The tags of
+%%      the links will be included as the "KeyData" for the bucket-key
+%%      pair returned.  Keys that were inputs to this phase that
+%%      reference non-existent objects are ignored
+%%      (i.e. {error,notfound} => []).
 mapreduce_linkfun({error, notfound}, _, _) -> [];
 mapreduce_linkfun(RiakObject, _, {Bucket, Tag}) ->
     %% TODO: could just pull links out of riak object directly, if that
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.