incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Metson <>
Subject Re: Extract JSON objects with Python?
Date Fri, 26 Jun 2009 08:30:57 GMT
I should add, depending on what manipulations you're going to make  
you're probably better off writing a view (you could even use a python  
view server...)

On 26 Jun 2009, at 10:29, Simon Metson wrote:

> 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, 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?)

View raw message