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 encodes start_key / startkey and end_key / endkey params differently #65

Closed
blakew opened this issue Oct 13, 2017 · 1 comment
Closed

Comments

@blakew
Copy link

blakew commented Oct 13, 2017

I have a composite key view aka key = [id, 0], [id, 1], .... When I use the start_key alias (with underscore), the uri encoding is incorrect. startkey passes the correct encoding.

    db.view(designdoc, viewname, {
        start_key: [req.params.id],
        end_key: [req.params.id, {}],
        include_docs: true,
    }, callback);

(incorrectly) encodes to start_key[0]=id&end_key[0]=id which in fact returns all documents in the view.

    db.view(designdoc, viewname, {
        startkey: [req.params.id],
        endkey: [req.params.id, {}],
        include_docs: true,
    }, callback);

(correctly) encodes to startkey=[id]&endkey=[id, {}] and returns the correct documents.

@big-r81
Copy link
Contributor

big-r81 commented Jun 20, 2022

I'm closing this old ticket. If it's still a problem, please reopen or create a new ticket.

@big-r81 big-r81 closed this as completed Jun 20, 2022
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