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:29:52 GMT
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).

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