Class CouchObject::Database
In: lib/couch_object/database.rb
Parent: Object
Enumerable Document StandardError HasManyAssociationError MissingView CantCompareSize DocumentNotFound BelongsToAssociationError HasOneAssociationError CouchDBError MapProcessError DatabaseSaveFailed NoDatabaseLocationSet Array HasManyRelation Response Database Server View Errors VERSION ClassMethods Persistable Utils CouchObject dot/f_3.png

A CouchDb database object

Methods

[]   all_databases   all_documents   create   delete   delete!   document   get   name   new   open   post   put   store   url   views  

Attributes

server  [RW] 

Public Class methods

All databases at uri

Create a new database at uri with the name if dbname

Delete the database at uri with the name if dbname

Open a connection to the database at uri, where uri is a full uri like: localhost:5984/foo

Public Instance methods

Get a document by id

Returns an Array of all the documents in this db

Send a DELETE request to the path which is relative to the database path so calling with with "bar" as the path in the "foo_db" database will call host:port/foo_db/bar. Returns a Response object

Get a document by id, optionally a specific revision too

Send a GET request to the path which is relative to the database path so calling with with "bar" as the path in the "foo_db" database will call host:port/foo_db/bar. Returns a Response object

Name of this database

Send a POST request to the path which is relative to the database path so calling with with "bar" as the path in the "foo_db" database will call host:port/foo_db/bar. The post body is the payload Returns a Response object

Send a PUT request to the path which is relative to the database path so calling with with "bar" as the path in the "foo_db" database will call host:port/foo_db/bar. The put body is the payload Returns a Response object

The full url of this database, eg localhost:5984/foo

[Validate]