Hi there,

I just tried that and it still gives an error. Any other idea?

erlang_couchdb:create_document({"localhost", 5984}, "iplaywow", {struct,
[{<<"name">>, <<"Korale">>}, {<<"type">>, <<"character">>}]}).
** exception exit: {json_encode,
                       {bad_term,
                           {struct,
                               [{<<"name">>,<<"Korale">>},
                                {<<"type">>,<<"character">>}]}}}
     in function  mochijson2:json_encode/2
     in call from erlang_couchdb:create_document/3
2>

-----Original Message-----
From: Benoit Chesneau [mailto:[email protected]] 
Sent: 25 July 2009 05:26 PM
To: [email protected]
Subject: Re: JSON encoding errors

2009/7/25 Lynton Grice <[email protected]>:

> It seems the problem lies entirely with the "mochijson2.erl" file. The
file
> I am using from the CouchDB download seems to let CouchDB run fine BUT
when
> I try use the "mochijson2" file from standard Erlang I get errors pretty
> much all the time.
>
> Any idea how I can solve these JSON errors?
>
I'm using mochijson2 for a library I expect to  release this we, and I
have no problem with it. It seem that you miss the struc term in your
doc :

[{<<"name">>,
<<"Korale">>}, {<<"type">>, <<"character">>}]

should be

{struct, [{<<"name">>,
<<"Korale">>}, {<<"type">>, <<"character">>}]}

- benoƮt

Reply via email to