Postcommit hook and storing json object

Yousuf Fauzan yousuffauzan at gmail.com
Sat Aug 25 15:56:36 EDT 2012


Hello,

In a postcommit hook, I am storing an object in another bucket where data
is equal to
    Data = iolist_to_binary(mochijson2:encode({struct, [
                {<<"status">>, list_to_binary(Status)},
                {<<"recorddate">>, list_to_binary(Recorddate)},
                {<<"memberlogin">>, list_to_binary(User)}
                ]})
and the content type is json.

Now when I run map reduce using JS, mapValuesJSON is actually giving me a
string instead of a dictionary.
I tried doing a JSON.parse of that with no luck.
can somebody help me figure out the right way to store JSON data in post
commit hook?

I tried without iolist_to_binary and then Riak.mapValuesJSON starts
throwing error.


--
Yousuf
http://fauzism.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20120826/a82ea051/attachment.html>


More information about the riak-users mailing list