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

Add Bookmark support for mango json queries #740

Merged
merged 3 commits into from Aug 16, 2017

Conversation

Projects
None yet
3 participants
@garrensmith
Member

garrensmith commented Aug 9, 2017

This adds a bookmark that is sent with each query and can be used to
continue a query from a specific key. This will allow users to paginate
mango queries.

Checklist

  • Code is written and works correctly;
  • Changes are covered by tests;
  • Documentation reflects the changes;
Add Bookmark support for mango json queries
This adds a bookmark that is sent with each query and can be used to
continue a query from a specific key. This will allow users to paginate
mango queries.
@willholley

This comment has been minimized.

Show comment
Hide comment
@willholley

willholley Aug 10, 2017

Member

testing a basic case where no results are returned, I get a response:

{"warning":"no matching index found, create an index to optimize query time",
"docs":[
],
"bookmark": "nil"}

However, passing "nil" back as a bookmark returns an error:

$ curl 'http://127.0.0.1:15984/test/_find' -H 'Content-Type:application/json' -d '{"selector":{"id":"willnotmatch"},"bookmark":"nil"}'
{"error":"invalid_bookmark","reason":"Invalid bookmark value: \"nil\""}
Member

willholley commented Aug 10, 2017

testing a basic case where no results are returned, I get a response:

{"warning":"no matching index found, create an index to optimize query time",
"docs":[
],
"bookmark": "nil"}

However, passing "nil" back as a bookmark returns an error:

$ curl 'http://127.0.0.1:15984/test/_find' -H 'Content-Type:application/json' -d '{"selector":{"id":"willnotmatch"},"bookmark":"nil"}'
{"error":"invalid_bookmark","reason":"Invalid bookmark value: \"nil\""}
@willholley

This comment has been minimized.

Show comment
Hide comment
@willholley

willholley Aug 10, 2017

Member

suggest adding a pagination test where each document emits the same value into the index to ensure progress is made using startkey_docid.

Member

willholley commented Aug 10, 2017

suggest adding a pagination test where each document emits the same value into the index to ensure progress is made using startkey_docid.

@garrensmith

This comment has been minimized.

Show comment
Hide comment
@garrensmith

garrensmith Aug 10, 2017

Member

Thanks @willholley I've fixed the issue and added another test.

Member

garrensmith commented Aug 10, 2017

Thanks @willholley I've fixed the issue and added another test.

@garrensmith

This comment has been minimized.

Show comment
Hide comment
@garrensmith

garrensmith Aug 14, 2017

Member

@tonysun83 thanks for the review. I've make some fixes based on your feedback

Member

garrensmith commented Aug 14, 2017

@tonysun83 thanks for the review. I've make some fixes based on your feedback

@tonysun83

This comment has been minimized.

Show comment
Hide comment
@tonysun83

tonysun83 Aug 15, 2017

Contributor

+1 after that fixing that weird end of line issue

Contributor

tonysun83 commented Aug 15, 2017

+1 after that fixing that weird end of line issue

@garrensmith garrensmith merged commit 89e99e5 into apache:master Aug 16, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

wohali added a commit that referenced this pull request Oct 19, 2017

Add Bookmark support for mango json queries (#740)
This adds a bookmark that is sent with each query and can be used to
continue a query from a specific key. This will allow users to paginate
mango queries.

willholley added a commit to willholley/couchdb that referenced this pull request May 22, 2018

Add Bookmark support for mango json queries (#740)
This adds a bookmark that is sent with each query and can be used to
continue a query from a specific key. This will allow users to paginate
mango queries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment