[erlang-questions] How to access a Map returned by jiffy:decode()

avinash D'silva evnix.com@REDACTED
Sat Jul 25 14:22:37 CEST 2015


I have the following code.
 Tx=jiffy:decode(<<"{\"foo\": \"bar\",\"key\": \"val\"}">>).

where Tx is:
{[{<<"foo">>,<<"bar">>},{<<"key">>,<<"val">>}]}

I tried the following:

maps:get("foo",Tx).
** exception error: {badmap,{[{<<"foo">>,<<"bar">>},{<<"key">>,<<"val">>}]}}
     in function  maps:get/2
        called as maps:get("foo",
                           {[{<<"foo">>,<<"bar">>},{<<"key">>,<<"val">>}]})

Any Idea on what I am doing wrong? any possible solutions?
I Couldn't find any documentation to access this type of map.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150725/544daef1/attachment.htm>


More information about the erlang-questions mailing list