incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lynton Grice" <lynton.gr...@logosworld.com>
Subject RE: JSON encoding errors
Date Sat, 25 Jul 2009 15:39:12 GMT
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:bchesneau@gmail.com] 
Sent: 25 July 2009 05:26 PM
To: user@couchdb.apache.org
Subject: Re: JSON encoding errors

2009/7/25 Lynton Grice <lynton.grice@logosworld.com>:

> 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


Mime
View raw message