added count to proxy
This commit is contained in:
parent
413a7602e8
commit
be7cd7442b
2 changed files with 7 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue