My favorites | Sign in
Project Home Issues Source
Search
for
GettingStarted  
Introduction to using couchdb-python.
Featured
Updated Dec 9, 2009 by djc.ochtman

Introduction

>>> import couchdb
>>> couch = couchdb.Server()
>>> db = couch.create('test')
>>> db
<Database 'test'>
>>> db['foo'] = {'bar': 'test'}
>>> db['foo']
<Document 'foo'@'1-1d1b1ba13d97badec02a57adb942cd42' {'bar': 'test'}>
>>> doc = db['foo']
>>> db.delete(doc)
>>> couch.delete('test')
Comment by ajar.vas...@gmail.com, Mar 2, 2010

can you select a document with some query language

Comment by porome...@gmail.com, Mar 2, 2010

db = couch["foo"]

to select a database.

Comment by thomas.p...@gmail.com, Mar 7, 2010

Can you write more documentation?

Comment by eric.sh...@gmail.com, Mar 21, 2010

Why do I get a connection refused error when I try to do line 3?

Comment by bassdr...@gmail.com, Mar 23, 2010

@eric Make sure your server is running.

Comment by cooldude...@gmail.com, Apr 2, 2010

Is there some API documentation somewhere ?

Comment by robertsh@gmail.com, Apr 5, 2010

There is a good example here

http://davidwatson.org/2008/02/python-couchdb-rocks.html

The documentation comes with the py-module.

Comment by venkates...@gmail.com, Jan 26, 2011

When trying to insert a document { u'id' : 1, u'name' : u'Sam' }, db.save(dict) fails with the following exception trace. Is there are work around this issue?

File "build\bdist.win32\egg\couchdb\client.py", line 404, in save
func = self.resource(doc['id']).put_json
File "build\bdist.win32\egg\couchdb\http.py", line 365, in call
obj = type(self)(urljoin(self.url, path), self.session)
File "build\bdist.win32\egg\couchdb\http.py", line 501, in urljoin
path = '/'.join([''] + [quote(s) for s in path])
File "build\bdist.win32\egg\couchdb\http.py", line 453, in quote
return urllib.quote(string, safe)
File "C:\Tools\python\python27\lib\urllib.py", line 1229, in quote
if not s.rstrip(safe):
AttributeError?: 'int' object has no attribute 'rstrip'

Comment by Matthias...@gmail.com, Jul 26, 2011

There really needs to be more of a tutorial/getting started,

let me point seeking souls to http://packages.python.org/CouchDB/getting-started.html

Comment by vpat...@orgmeta.com, Jan 11, 2012

There seems to be no way to authenticate the admin user want to create database


Sign in to add a comment
Powered by Google Project Hosting