Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 33651 invoked from network); 26 Jun 2009 08:30:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Jun 2009 08:30:18 -0000 Received: (qmail 28205 invoked by uid 500); 26 Jun 2009 08:30:28 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 28170 invoked by uid 500); 26 Jun 2009 08:30:28 -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 28160 invoked by uid 99); 26 Jun 2009 08:30:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Jun 2009 08:30:28 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of simonmetson@googlemail.com designates 209.85.219.216 as permitted sender) Received: from [209.85.219.216] (HELO mail-ew0-f216.google.com) (209.85.219.216) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Jun 2009 08:30:17 +0000 Received: by ewy12 with SMTP id 12so3514921ewy.11 for ; Fri, 26 Jun 2009 01:29:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=AJ3FBroeZaLCi2MsGAVOU6RuhuKamvVwmY98F0VPJuk=; b=wNqN5CIT8hTb12e/Q/DR95gE589RQ22gSiEK9cENfv/LKzV7caTjUqeSkNDV5CZCp9 KpMARqWwTwfsOPKL1BTReIeW7Ezj92mzxP5HLKFN2jGF3tElDNjGIrNgttZ1za4uo9oC /DG7rI3XRUCiprhaajldQkqHbsHgQ54Z5HsQA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=TyAqHNXGr+CbzocSeJsINy+CCmGK2yq/KOYu5QDgVPsPrZErdF2CcD//48MTk112LW LqRiqVUuj4+Dkmr6u8+z2d9fkrI0PCc+TCWh/R9V0us2GJd7/Aq0cxCxc7MFzh2K8nD0 JF4JT0W8pzMAi14cMI4DadNXbyaF3zf+2tbTU= Received: by 10.210.78.16 with SMTP id a16mr3965378ebb.70.1246004996228; Fri, 26 Jun 2009 01:29:56 -0700 (PDT) Received: from pb-d-128-141-224-156.cern.ch (pb-d-128-141-224-156.cern.ch [128.141.224.156]) by mx.google.com with ESMTPS id 10sm2061458eyd.28.2009.06.26.01.29.53 (version=SSLv3 cipher=RC4-MD5); Fri, 26 Jun 2009 01:29:55 -0700 (PDT) Message-Id: <79332309-0669-41B9-A6B5-45199AE45AA7@googlemail.com> From: Simon Metson To: user@couchdb.apache.org In-Reply-To: <20090626082258.222BC2C005D3@bmail01.one.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: Extract JSON objects with Python? Date: Fri, 26 Jun 2009 10:29:52 +0200 References: <20090626075712.BD9C43000204@bmail00.one.com> <2d8fb9950906260107g54ba489dl9f060b3d49fc1d9@mail.gmail.com> <20090626082258.222BC2C005D3@bmail01.one.com> X-Mailer: Apple Mail (2.935.3) X-Virus-Checked: Checked by ClamAV on apache.org You can get the json doc at http://localhost:5984/database/doc_id - which might mean you'd want to set the _id in such a way as sto be useful (e.g. username). Cheers Simon On 26 Jun 2009, at 10:22, maillist@ol-mars.se wrote: > Ok, but I didn't mean to extract it directly from a local file > (sorry if > I didn't explain my problem properly) but more ask the db a question > that returns an entire JSON object. > > For example, say I have a db called persons, with a key Mark and a key > Marcus. They both have the fields (_id and _rev) address, > phonenumber,... and so on. > > I want my server application (a pylons server btw) to extract this > information about mark and marcus and present them as JSON objects for > another server to parse in JS. This is why I'm wondering if I can > get a > JSON object from the db directly instead of asking for address, phone, > and so on, to build a new JSON object and present. > > It would be even better if someone knew how to do this in python, but > all ways are good ways :P > > > On Jun 26, 2009 10:07 "Sergey Shepelev" wrote: > >> If you want to open Couch database as local file and read it's >> content >> and >> try to operate JSON objects inside, that is possible.But it would be >> very >> bad idea. Just because there is already written code (couchdb) which >> does >> that and provides you with HTTP API. >> >> On Fri, Jun 26, 2009 at 11:57 AM, wrote: >> >>> CouchDB stores objects in JSON format right? >>> >>> Is there any way to extract these JSON objects from CouchDB >>> directly? >>> The server that extracts from the db are supposed to present JSON >>> objects, so it would be stupid to create new objects if they are >>> stored >>> in the correct syntax. >>> >>> Is this possible in Python? (if not, in any other language?)