Resetting skip and limit when trying to get total count
This commit is contained in:
parent
00a4cc7f3b
commit
cacc320235
2 changed files with 10 additions and 2 deletions
|
@ -113,7 +113,7 @@ module CouchRest
|
|||
def count
|
||||
raise "View#count cannot be used with group options" if query[:group]
|
||||
if can_reduce?
|
||||
row = reduce.rows.first
|
||||
row = reduce.skip(0).limit(1).rows.first
|
||||
row.nil? ? 0 : row.value
|
||||
else
|
||||
limit(0).total_rows
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue