Skip to content
This repository was archived by the owner on Oct 17, 2022. It is now read-only.

Queries endpoint support#241

Merged
jiangphcn merged 1 commit intoapache:masterfrom
cloudant:issue-820-add-queries-for_all_docs
Mar 19, 2018
Merged

Queries endpoint support#241
jiangphcn merged 1 commit intoapache:masterfrom
cloudant:issue-820-add-queries-for_all_docs

Conversation

@jiangphcn
Copy link
Copy Markdown
Contributor

@jiangphcn jiangphcn commented Jan 25, 2018

Overview

Document new feature for multiple queries against POST /{db}/_all_docs/queries. This allows to execute multiple specified built-in view queries of all documents in specified database. This enables you to request multiple documents in a single request, in place of multiple POST /{db}/_all_docs requests.

The multiple queries are also supported in /db/_local_docs/queries and /db/_design_docs/queries (similar to /db/_all_docs/queries).

In addition, the multiple queries against view are supported in newly introduced endpoint /{db}/_design/{ddoc}/_view/{view}/querie

Testing recommendations

see apache/couchdb#1032

GitHub issue number

Issue #820

Related Pull Requests

apache/couchdb#820
apache/couchdb#1222

Checklist

  • Documentation is written and is accurate;
  • make check passes with no errors
  • [] Update rebar.config.script with the commit hash once this PR is rebased and merged

Copy link
Copy Markdown
Member

@flimzy flimzy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the queries parameter not be added to the existing POST /{db}/_all_docs documentation? Having a separate example like this is probably still useful, but since the new functionality is added to an existing endpoint, I would hate not to have complete documentation in one canonical place, as well.

Comment thread src/api/database/bulk-api.rst Outdated
:synopsis: Returns results for the specified queries

Executes multiple specified built-in view queries of all documents in this
database. This enables you to request multiple documents in a single
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it would be worth explaining in more detail that (as I understand) this allows combining the results of multiple queries, not just multiple documents (_all_docs already returns multiple documents, so I can see room for confusion, upon a cursory read of this statement). Perhaps something like:

This enables you to request the results of multiple queries in a single request, in place of ...

@jiangphcn jiangphcn force-pushed the issue-820-add-queries-for_all_docs branch from 886584d to 5a6a6bd Compare January 25, 2018 08:17
@jiangphcn
Copy link
Copy Markdown
Contributor Author

Thanks Jonathan @flimzy. I just added commit to change documents to queries to make it clearer.

Regarding comment below

Should the queries parameter not be added to the existing POST /{db}/_all_docs documentation? Having a separate example like this is probably still useful, but since the new functionality is added to an existing endpoint, I would hate not to have complete documentation in one canonical place, as well.

I think that I need to mention that this is newly added feature. Making separate section can help explain the difference between previous feature and new feature. In addition, reader can easily find the newly added section because it is just near to POST /{db}/_all_docs documentation. In addition, current organization is same as page in http://docs.couchdb.org/en/latest/api/ddoc/views.html

@flimzy
Copy link
Copy Markdown
Member

flimzy commented Jan 25, 2018

I think that I need to mention that this is newly added feature. Making separate section can help explain the difference between previous feature and new feature.

Sure. I didn't mean to suggest there shouldn't also be a new section to highlight the added functionality, just that it might be nice to ensure that the existing endpoint documentation also contains the full documentation for that endpoint.

@jiangphcn
Copy link
Copy Markdown
Contributor Author

Cool, thanks @flimzy for your clarification and review.

@jiangphcn jiangphcn changed the title Add statement for multiple queris for _all_docs Add statement for multiple queries for _all_docs Jan 29, 2018
@jiangphcn jiangphcn changed the title Add statement for multiple queries for _all_docs [WIP] Add statement for multiple queries for _all_docs Feb 6, 2018
@wohali
Copy link
Copy Markdown
Member

wohali commented Mar 9, 2018

@jiangphcn please mesh this with apache/couchdb#820 and #244 so that we get the right documentation in the upcoming 2.2.0 release, please. Thanks!

@jiangphcn
Copy link
Copy Markdown
Contributor Author

Okay Joan. Will do soon.

@jiangphcn jiangphcn force-pushed the issue-820-add-queries-for_all_docs branch 3 times, most recently from fd68264 to 1336ca3 Compare March 16, 2018 06:45
@jiangphcn jiangphcn changed the title [WIP] Add statement for multiple queries for _all_docs Multiple queries support Mar 16, 2018
@jiangphcn
Copy link
Copy Markdown
Contributor Author

@flimzy,Hey Jonathan, could you please review this PR? This is because we adjust endpoints to

  • /{db}/_all_docs/queries
  • /db/_local_docs/queries
  • /db/_design_docs/queries
  • /{db}/_design/{ddoc}/_view/{view}/queries

@jiangphcn jiangphcn changed the title Multiple queries support Queries endpoint support Mar 16, 2018
Copy link
Copy Markdown
Member

@flimzy flimzy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few minor changes.

Comment thread src/api/database/bulk-api.rst Outdated
:code 200: Request completed successfully
:code 400: Invalid request
:code 401: Read permission required
:code 404: Specified database is missed
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/missed/missing/

Comment thread src/api/ddoc/views.rst Outdated
:code 200: Request completed successfully
:code 400: Invalid request
:code 401: Read permission required
:code 404: Specified database, design document or view is missed
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/missed/missing/

Comment thread src/api/ddoc/views.rst Outdated

.. warning::
Using POST to /{db}/_design/{ddoc}/_view/{view} is still supported and
allows to get multiple query result to a view. This is described below.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/allows/allows you/

@wohali
Copy link
Copy Markdown
Member

wohali commented Mar 18, 2018

Looks like there is a conflict that needs to be resolved in src/api/database/bulk-api.rst.

@wohali wohali mentioned this pull request Mar 18, 2018
1 task
@jiangphcn jiangphcn force-pushed the issue-820-add-queries-for_all_docs branch 2 times, most recently from 5d5a49e to 9470572 Compare March 19, 2018 02:44
@jiangphcn
Copy link
Copy Markdown
Contributor Author

Thanks @flimzy for your comments. I already addressed them. Also, thanks @wohali for kind reminder, and I already addressed conflict.

Copy link
Copy Markdown
Member

@flimzy flimzy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! +1

  - POST /{db}/_all_docs/queries
    Executes multiple specified built-in view queries of all documents
    in this database. This enables you to request multiple documents
    in a single request, in place of multiple POST /{db}/_all_docs requests.

issue 820
@jiangphcn jiangphcn force-pushed the issue-820-add-queries-for_all_docs branch from 9470572 to e4e0fba Compare March 19, 2018 08:46
@jiangphcn jiangphcn merged commit ec608bf into apache:master Mar 19, 2018
@jiangphcn jiangphcn deleted the issue-820-add-queries-for_all_docs branch March 19, 2018 08:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants