|
8 | 8 |
|
9 | 9 | """Python client API for CouchDB.
|
10 | 10 |
|
11 |
| ->>> server = Server('http://localhost:8888/') |
| 11 | +>>> server = Server('http://localhost:5984/') |
12 | 12 | >>> db = server.create('python-tests')
|
13 | 13 | >>> doc_id = db.create({'type': 'Person', 'name': 'John Doe'})
|
14 | 14 | >>> doc = db[doc_id]
|
@@ -54,7 +54,7 @@ class ServerError(Exception):
|
54 | 54 | class Server(object):
|
55 | 55 | """Representation of a CouchDB server.
|
56 | 56 |
|
57 |
| - >>> server = Server('http://localhost:8888/') |
| 57 | + >>> server = Server('http://localhost:5984/') |
58 | 58 |
|
59 | 59 | This class behaves like a dictionary of databases. For example, to get a
|
60 | 60 | list of database names on the server, you can simply iterate over the
|
@@ -82,7 +82,7 @@ def __init__(self, uri):
|
82 | 82 | """Initialize the server object.
|
83 | 83 |
|
84 | 84 | :param uri: the URI of the server (for example
|
85 |
| - ``http://localhost:8888/``) |
| 85 | + ``http://localhost:5984/``) |
86 | 86 | """
|
87 | 87 | self.resource = Resource(httplib2.Http(), uri)
|
88 | 88 |
|
@@ -156,7 +156,7 @@ def create(self, name):
|
156 | 156 | class Database(object):
|
157 | 157 | """Representation of a database on a CouchDB server.
|
158 | 158 |
|
159 |
| - >>> server = Server('http://localhost:8888/') |
| 159 | + >>> server = Server('http://localhost:5984/') |
160 | 160 | >>> db = server.create('python-tests')
|
161 | 161 |
|
162 | 162 | New documents can be added to the database using the `create()` method:
|
@@ -294,7 +294,7 @@ def get(self, id, default=None, **options):
|
294 | 294 | def query(self, code, content_type='text/javascript', **options):
|
295 | 295 | """Execute an ad-hoc query (a "temp view") against the database.
|
296 | 296 |
|
297 |
| - >>> server = Server('http://localhost:8888/') |
| 297 | + >>> server = Server('http://localhost:5984/') |
298 | 298 | >>> db = server.create('python-tests')
|
299 | 299 | >>> db['johndoe'] = dict(type='Person', name='John Doe')
|
300 | 300 | >>> db['maryjane'] = dict(type='Person', name='Mary Jane')
|
@@ -341,7 +341,7 @@ def update(self, documents):
|
341 | 341 | """Perform a bulk update or insertion of the given documents using a
|
342 | 342 | single HTTP request.
|
343 | 343 |
|
344 |
| - >>> server = Server('http://localhost:8888/') |
| 344 | + >>> server = Server('http://localhost:5984/') |
345 | 345 | >>> db = server.create('python-tests')
|
346 | 346 | >>> for doc in db.update([
|
347 | 347 | ... Document(type='Person', name='John Doe'),
|
@@ -372,7 +372,7 @@ def update(self, documents):
|
372 | 372 | def view(self, name, **options):
|
373 | 373 | """Execute a predefined view.
|
374 | 374 |
|
375 |
| - >>> server = Server('http://localhost:8888/') |
| 375 | + >>> server = Server('http://localhost:5984/') |
376 | 376 | >>> db = server.create('python-tests')
|
377 | 377 | >>> db['gotham'] = dict(type='City', name='Gotham City')
|
378 | 378 |
|
|
0 commit comments