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

design_search needs POST support to use key feature #56

Closed
davbwhit opened this issue Aug 7, 2017 · 5 comments
Closed

design_search needs POST support to use key feature #56

davbwhit opened this issue Aug 7, 2017 · 5 comments
Milestone

Comments

@davbwhit
Copy link

davbwhit commented Aug 7, 2017

Get "Error: (400) - invalid UTF-8 JSON" when trying to specify a key to retrieve from a view.

Couch documentation 10.5.4 indicates:
Unlike GET /{db}/_design/{ddoc}/_view/{view} for accessing views, the POST method supports the specification of explicit keys to be retrieved from the view results. The remainder of the POST view functionality is identical to the GET /{db}/_design/{ddoc}/_view/{view} API.

Any chance of getting an updated design_search with POST support to handle the super-set of features?

@sckott
Copy link
Contributor

sckott commented Aug 8, 2017

hi @davbwhit thanks for opening the issue

I'll have a look, perhaps may be a quick fix

@sckott sckott closed this as completed in 57e45c8 Oct 20, 2017
@sckott
Copy link
Contributor

sckott commented Oct 20, 2017

@davbwhit can you try again after reinstalling like devtools::install_github("ropensci/sofa")

can do POST now if you use body parameter, and also design_search_many function added for sending many queries at once.

@sckott sckott added this to the v0.3 milestone Oct 20, 2017
@ghost
Copy link

ghost commented Nov 28, 2017

How do you specify a key? I have a composite key on two fields , on is a id field (string) and other is a timstamp that is an integer. Trying variations of the following and getting various errors.

design_search(connection, 'dbname', 'designname', 'viewname', key = list('09f3eef7b47164b0ed9f1b7775f3e5be', 1511170394))
Error in lapply(x, f) : attempt to apply non-function

@sckott
Copy link
Contributor

sckott commented Nov 29, 2017

@tumulurig3 try giving that list to the body parameter, like body = list(keys = c('09f3eef7b47164b0ed9f1b7775f3e5be', 1511170394))

@ghost
Copy link

ghost commented Nov 29, 2017

Had some issue making the above work, but re-starting RStudio and re-invoking the library made the call work with above format. However, it returns no documents, even though I know that key exists in the DB. Perhaps some other issue. Thank 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