Return-Path: Delivered-To: apmail-incubator-couchdb-user-archive@locus.apache.org Received: (qmail 19162 invoked from network); 19 Jun 2008 14:18:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Jun 2008 14:18:25 -0000 Received: (qmail 81066 invoked by uid 500); 19 Jun 2008 14:18:26 -0000 Delivered-To: apmail-incubator-couchdb-user-archive@incubator.apache.org Received: (qmail 81036 invoked by uid 500); 19 Jun 2008 14:18:26 -0000 Mailing-List: contact couchdb-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: couchdb-user@incubator.apache.org Delivered-To: mailing list couchdb-user@incubator.apache.org Received: (qmail 81025 invoked by uid 99); 19 Jun 2008 14:18:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Jun 2008 07:18:26 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of brking@gmail.com designates 74.125.44.153 as permitted sender) Received: from [74.125.44.153] (HELO yx-out-1718.google.com) (74.125.44.153) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Jun 2008 14:17:34 +0000 Received: by yx-out-1718.google.com with SMTP id 36so112320yxh.0 for ; Thu, 19 Jun 2008 07:17:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=iXsKp7X9X6mftHA5nMRjkQ77aIKlewsUap2vrSZar/U=; b=bfs7UsrGwY86fJ+kNH7ee4o1WI7GlJs5QgmFqNoCRdmO4VFvjJDFo98EAoz2pJLELv UDd6g7Uip6Xp+K7ulE3pDQi66Hub9jfc8l5ZjZW/t0G6cayp2mMWtc9ey2Pdb/LlLc8n XQgUk4QYXJnxOKPorNbihXzBBxjz9gKVlTPVw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=PJB+JU8nZ7N3LuMFAvx+JfBLXjehQzHOtcynijlf9kRGTKbBvYB8+twhXNQYTJgYLz 7eUK4nTKbcYXi6oljLr5fM+EuRkB1n6Bc0NFKyfshFSgHroAEY2UpX4VhTRENizCjZ6q kgNv1B8bgVNeTp5nXhL01BF0uugLV9/Ip1ozk= Received: by 10.115.90.1 with SMTP id s1mr2655901wal.51.1213885054968; Thu, 19 Jun 2008 07:17:34 -0700 (PDT) Received: by 10.114.182.11 with HTTP; Thu, 19 Jun 2008 07:17:34 -0700 (PDT) Message-ID: <888cd9180806190717k45ba3e73jaf2c0d8418d9a789@mail.gmail.com> Date: Thu, 19 Jun 2008 10:17:34 -0400 From: "Brad King" To: couchdb-user@incubator.apache.org Subject: Json.Net and couchbrowse MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org If you happen to be working in c#, you might want to check out James-Newton Kings Json.Net library. It seems more robust than LitJson used in CouchBrowse, and supports LINQ queries. It does an excellent job serializing .Net types, and exposes good controls over serialization hangups like dealing with nulls. http://james.newtonking.com/pages/json-net.aspx Using Json.net linq syntax simplifies (relatively) parsing some of the result structures in couchbrows into .Net objects: public DocInfo[] GetAllDocuments(string server,string db) { string result=DoRequest(server+"/"+db+"/_all_docs","GET"); JObject o = JObject.Parse(result); var docs = from p in o["rows"].Children() select new DocInfo { ID = p.Value("id"), Revision = p["value"].Value("rev") }; return docs.ToArray(); } In general, the c# couchbrowse package appears to be out of date, but its a decent starting point. I've got the modified base I/O converted to json.net if anyone else would like it, let me know.