couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Charette <ioma...@yahoo.com>
Subject Re: http equivalent of curl example
Date Thu, 28 Feb 2013 17:19:44 GMT
Also note that doing a request from the url makes it a get not a post.

Try using jquery or you can use 
http://daleharvey.github.com/jquery.couch.js-docs/symbols/index.html

located at
http://localhost:5984/_utils/script/jquery.couch.js


Jeff Charette | Principal 
We Are Charette
web / identity / packaging

m  415.298.2707
w  wearecharette.com
e   jeffrey@wearecharette.com

On Feb 28, 2013, at 11:45 AM, Robert Newson <rnewson@apache.org> wrote:

> you can do ?keys=["foo","bar"] in newer couchdb version, obviously up
> the practical url limit of around 2k (or 4k now?).
> 
> B.
> 
> On 28 February 2013 16:38, Tim Tisdall <tisdall@gmail.com> wrote:
>> In that example the variables are being passed in as POST values.  You're
>> adding them to the URL which is making them GET variables.  Do you have
>> code examples that you're trying to use in Javascript?  Are you using
>> jQuery?
>> 
>> 
>> On Thu, Feb 28, 2013 at 11:32 AM, Alexander Gabriel <alex@barbalex.ch>wrote:
>> 
>>> Hi
>>> 
>>> The couchdb docs are full of examples using curl.
>>> 
>>> My problem is, I'm a noob and a windows user. And I am programming using
>>> Javascript, not Curl (I suspect most of you are?).
>>> Well, I have spent quite a while sitting in front of all these examples
>>> scratching my head and wondering how to write them in http. I'd better just
>>> ask an example:
>>> 
>>> What would this here: curl -d '{"keys":["bar","baz"]}' -X POST
>>> http://127.0.0.1:5984/foo/_all_docs?include_docs=true
>>> 
>>> be in http?
>>> 
>>> I have tried this:
>>> http://127.0.0.1:5984/foo/_all_docs?include_docs=true&id=["bar","baz"]
>>> 
>>> In case this is correct then maybe it did not work for me because my array
>>> contains hundreds, sometimes thousands of id's which is why I am looking
>>> for a way to fetch them all in one request.
>>> 
>>> What would the best way be to fetch hundreds of docs of which you know the
>>> id and can't use a view? (other than opening every on single)
>>> 
>>> My use-case: Importing big lists into a couch. The data in the uploaded
>>> .csv-files comes with id's and has to be inserted into the corresponding
>>> docs.
>>> 
>>> Cheers
>>> Alex
>>> 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message