Hi,

Obliviously ejson:decode wouldn't handle list_to_binary output right
since this isn't valid JSON. Have you tried to do
Send(ejson:encode(TheObj)) instead?
--
,,,^..^,,,


On Fri, Nov 14, 2014 at 1:02 PM, Sanjaya Amarasinghe <[email protected]> wrote:
> Hi,
>
> Using an Erlang list function I do the following :
>
> *Send(list_to_binary(io_lib:format("~p~n", [TheObj]))),*
>
> A sample of what I get as the result is as follows :
>
> ----------------
> {{[{<<"_id">>,<<"54cc5f3f6db028666fdcb4b75ca0712f">>},
>   {<<"_rev">>,<<"3-c477c16c92cdfc94ea5c619c7363650e">>},
>   {<<"attrib1">>,true},
>   {<<"complexAttrib">>,
>    {[{<<"attrib2">>,<<"54cc5f3f6db028666fdcb4b75ca0712f">>},
>      {<<"attrib3">>,<<"abc123">>}
>      }]}},
>   {<<"attrib4">>,<<"qwertyuiop">>},
>   {<<"attrib5">>,true}]}
> }
> ----------------
>
>
> I need the "TheObj" to get printed in the proper JSON format in the
> result.  I tried with ejeson:decode() and didn't get any success..
>
> Can somebody help me with this ?
>
> Thank you.
> Regards,
> Sanjaya

Reply via email to