Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

db.view() does not return total_rows count #325

Open
squirrelpiles opened this issue Feb 23, 2017 · 1 comment
Open

db.view() does not return total_rows count #325

squirrelpiles opened this issue Feb 23, 2017 · 1 comment

Comments

@squirrelpiles
Copy link

If I call a view in couchDB, it returns something like:
{"total_rows":14,"offset":0,"rows":[...] }

The "total_rows" is the count of how many total possible rows the view contains. The size of rows[] is the number of rows ACTUALLY returned based on limit (if specified) and skip values.

dw.view() does not seem to return "total_rows" or "offset". How can I know how many total rows are in the view so i can page?

Can you return a result that looks like: {"total_rows":14,"offset":0,"rows":[...] }

@gianluca311
Copy link

I solved that by setting up the responses as raw.

new(cradle.Connection)('http://living-room.couch', 5984, { cache: true, raw: true });

This might be a solution for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants