Module CouchRest::Mixins::DocumentQueries::ClassMethods
In: lib/couchrest/mixins/document_queries.rb

Methods

all   count   first   get   get!  

Public Instance methods

Load all documents that have the "couchrest-type" field equal to the name of the current class. Take the standard set of CouchRest::Database#view options.

Returns the number of documents that have the "couchrest-type" field equal to the name of the current class. Takes the standard set of CouchRest::Database#view options

Load the first document that have the "couchrest-type" field equal to the name of the current class.

Returns

Object:The first object instance available

or

Nil:if no instances available

Parameters

opts<Hash>:: View options, see CouchRest::Database#view options for more info.

Load a document from the database by id No exceptions will be raised if the document isn‘t found

Returns

Object:if the document was found

or Nil::

Parameters

id<String, Integer>:Document ID
db<Database>:optional option to pass a custom database to use

Load a document from the database by id An exception will be raised if the document isn‘t found

Returns

Object:if the document was found

or Exception

Parameters

id<String, Integer>:Document ID
db<Database>:optional option to pass a custom database to use

[Validate]