Class | CouchRest::Database |
In: |
lib/couchrest/database.rb
|
Parent: | Object |
bulk_save_cache_limit | [RW] | |
host | [R] | |
name | [R] | |
root | [R] | |
server | [R] | |
uri | [R] |
Create a CouchRest::Database adapter for the supplied CouchRest::Server and database name.
server<CouchRest::Server>: | database host |
name<String>: | database name |
COPY an existing document to a new id. If the destination id currently exists, a rev must be provided. dest can take one of two forms if overwriting: "id_to_overwrite?rev=revision" or the actual doc hash with a ‘_rev’ key
DELETE the document from CouchDB that has the given _id and _rev.
If bulk is true (false by default) the deletion is recorded for bulk-saving (bulk-deletion :) later. Bulk saving happens automatically when bulk_save_cache limit is exceded, or on the next non bulk save.
Replicates via "pulling" from another database to this database. Makes no attempt to deal with conflicts.
Save a document to CouchDB. This will use the _id field from the document as the id for PUT, or request a new UUID from CouchDB, if no _id is present on the document. IDs are attached to documents on the client side because POST has the curious property of being automatically retried by proxies in the event of network segmentation and lost responses.
If bulk is true (false by default) the document is cached for bulk-saving later. Bulk saving happens automatically when bulk_save_cache limit is exceded, or on the next non bulk save.
If batch is true (false by default) the document is saved in batch mode, "used to achieve higher throughput at the cost of lower guarantees. When […] sent using this option, it is not immediately written to disk. Instead it is stored in memory on a per-user basis for a second or so (or the number of docs in memory reaches a certain point). After the threshold has passed, the docs are committed to disk. Instead of waiting for the doc to be written to disk before responding, CouchDB sends an HTTP 202 Accepted response immediately. batch=ok is not suitable for crucial data, but it ideal for applications like logging which can accept the risk that a small proportion of updates could be lost due to a crash."
Updates the given doc by yielding the current state of the doc and trying to update update_limit times. Returns the new doc if the doc was successfully updated without hitting the limit
Query a CouchDB view as defined by a _design document. Accepts paramaters as described in wiki.apache.org/couchdb/HttpViewApi