Module to manage access to databases in couchdb.
Object that abstract access to a CouchDB database A Database object could act as a Dict object.
Properties
Methods
Get infos of database
Returns: | dict |
---|
Test if document exist in database
Parameters: |
|
---|---|
Returns: | boolean, True if document exist |
Get document from database
Args: :param docid: str, document id to retrieve :param rev: if specified, allow you to retrieve a specifiec revision of document :param wrapper: callable. function that take a dict as param. Used to wrap an object.
Returns: | dict, representation of CouchDB document as a dict. |
---|
retrieve revisions of a doc
Parameters: |
|
---|
dict with revisions as member, if false return only revisions
Returns: | dict: ‘_rev_infos’ member if you have set with_doc |
---|
to True :
{
"_revs_info": [
{"rev": "123456", "status": "disk"},
{"rev": "234567", "status": "missing"},
{"rev": "345678", "status": "deleted"},
]
}
If False, return current revision of the document, but with an additional field, _revs, the value being a list of the available revision IDs.
Save one documents or multiple documents.
Parameters: |
|
---|---|
Returns: | dict or list of dict: dict or list are updated |
with doc ‘_id’ and ‘_rev’ properties returned by CouchDB server.
delete a document or a list of document
Parameters: |
|
---|
of documents or list with _id and _rev, optionnaly _deleted member set to true. See _bulk_docs document on couchdb wiki.
Returns: | list of doc or dict like: |
---|
{"ok":true,"rev":"2839830636"}
delete attachement of documen
Parameters: |
|
---|---|
Returns: | dict, withm member ok setto True if delete was ok. |
See also
References Server class, Views classes