Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 6361 invoked from network); 25 Jul 2009 15:38:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 25 Jul 2009 15:38:49 -0000 Received: (qmail 27234 invoked by uid 500); 25 Jul 2009 15:39:53 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 27170 invoked by uid 500); 25 Jul 2009 15:39:52 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 27160 invoked by uid 99); 25 Jul 2009 15:39:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Jul 2009 15:39:52 +0000 X-ASF-Spam-Status: No, hits=4.4 required=10.0 tests=MSGID_MULTIPLE_AT,RCVD_IN_BL_SPAMCOP_NET,SPF_HELO_PASS,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [212.227.17.8] (HELO moutng.kundenserver.de) (212.227.17.8) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Jul 2009 15:39:42 +0000 Received: from NC10 (gprs01.rb.mtnns.net [41.208.50.160]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0MKsym-1MUjLE2ofK-000Y7x; Sat, 25 Jul 2009 17:39:22 +0200 From: "Lynton Grice" To: References: <2647565988304833579@unknownmsgid> In-Reply-To: Subject: RE: JSON encoding errors Date: Sat, 25 Jul 2009 17:39:12 +0200 Message-ID: <000301ca0d3e$12d2f8b0$3878ea10$@grice@logosworld.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcoNPFZE1T8vQ6U5Tx2jISWVIzRLlAAAaO8g Content-Language: en-za X-Provags-ID: V01U2FsdGVkX1+Pp+neEYzbJIDmanUdsdfO8jY9/BvaE42YdAZ +4IllcQJzIL7+NO8FupOFLXWbAf3Hgs9sxDL+YABV/e4MlHw9P mAfZel8sMTAEfl8vCOX8r8IaYzqBg3Ep7BRAqSKsUI= X-Virus-Checked: Checked by ClamAV on apache.org 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]=20 Sent: 25 July 2009 05:26 PM To: user@couchdb.apache.org Subject: Re: JSON encoding errors 2009/7/25 Lynton Grice : > 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=EEt