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

Perform search over POST too #32

Closed
carlosduclos opened this issue Mar 17, 2017 · 3 comments
Closed

Perform search over POST too #32

carlosduclos opened this issue Mar 17, 2017 · 3 comments

Comments

@carlosduclos
Copy link
Contributor

Original issue

TheHominid
A too long search query results in an error 400 from couchDB (due to GET url length limitations), however if the same query is sent inside the body with a POST call, couchDB works properly.
From the code it seems that nano can only perform search operations over GET and not POST.

@popojargo
Copy link
Member

@glynnbird Hi Glynn! I really need to make a call on _all_docs using the POST method. I would like to implement this feature in nano.

I'm wondering what would be the best approach to implement this new route:

  1. Should I make the nano.db.list configurable with a parameter to decide if we use GET or POST
  2. Create a new function (perhaps, nano.db.listWithPost)
  3. Always pass the keys in the body and always use the GET instead of POST.

For 3, I fear that it could cause some problems if people have custom proxies that limit the method/endpoints accessible.

Let me know what you think!

@glynnbird
Copy link
Contributor

There's already an API call do do that. It's called fetchDocs !

https://github.com/apache/couchdb-nano/blob/master/lib/nano.js#L585-L597

@popojargo
Copy link
Member

Ah my bad! Thanks glynn! I think we can also close this issue.

@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

4 participants