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

querying a doc with a show function #263

Open
eroux opened this issue Mar 14, 2017 · 1 comment
Open

querying a doc with a show function #263

eroux opened this issue Mar 14, 2017 · 1 comment

Comments

@eroux
Copy link

eroux commented Mar 14, 2017

I have the following design document:

{
  "_id": "_design/jsonld",
  "_rev": "6-1d31766f96fe194d286cc9cf8c31e5c6",
  "shows": {
    "jsonld": "function(doc, req) {\n  return toJSON(doc[\"@graph\"]);\n}"
  },
  "language": "javascript"
}

and would like to query documents according to this view. It seems impossible with the current API.

@YannRobert
Copy link
Collaborator

You're right, there is no explicit way to query a show function.

You may be able to do it by either :

  • extending the ViewQuery class in order to override org.ektorp.ViewQuery#buildQueryURI so that is generated the appropriate URI : "_show" instead of "_view" then pass it to org.ektorp.CouchDbConnector#queryForStream
  • directly use a org.ektorp.http.RestTemplate instance with the appropriate URI
  • change Ektorp to allow explicit support for show queries, then propose a pull request

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

No branches or pull requests

2 participants