added count to proxy

This commit is contained in:
Daniel Kirsch 2009-07-21 14:14:58 +02:00
parent 413a7602e8
commit be7cd7442b
2 changed files with 7 additions and 0 deletions

View file

@ -59,6 +59,10 @@ module CouchRest
@klass.all({:database => @database}.merge(opts), &block)
end
def count(opts = {}, &block)
@klass.all({:raw => true, :limit => 0}.merge(opts), &block)['total_rows']
end
def first(opts = {})
@klass.first({:database => @database}.merge(opts))
end