couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Audrey Lee <>
Subject Newb: curl, javascript, jQuery.ajax, bad-browsers, rest-client rubygem?
Date Thu, 01 Apr 2010 20:02:05 GMT
Dear couchDB List,

I am a couchDB beginner.

I installed this couchDB version on my Mac:
  - 0.10

Today I finished a quick study of the futon-UI.

Now I like futon.

After futon I made the next step up which perhaps might be curl.

I got all these curl commands to work on my Mac:

Create a DB:
  - curl -X PUT

Create a document:
  - curl -X PUT -d '{"_id":"audreydoc10","name":"i_am_audreydoc10" }'

A curl command which reads my JSON from a file rather than from the
command line:
  - curl -X PUT -T my_json.json localhost:5984/audreydb/audreydoc176

List all DB:
  - curl -X GET

Delete DB:
  - curl -X DELETE

Get a document (useful for getting a rev):
  - curl -X GET

Delete a doc (GET a rev 1st):
  - curl -X DELETE"1-a67cc301ab176c5561899d7bae78bbb7"

Copy a doc:
  - curl -X COPY -H
"Destination: audreydoc176_copy"

Update a doc:
  - do a GET to get the rev:
  - curl -X GET
  - curl -X PUT -d
'{"_rev":"3-204132c15193747f9962fe1284a6a5bf", "name":"my doc"}'

List all documents:
  - curl -X GET

get db info:
  - curl -X GET

List all documents (ORDER and set LIMIT)
  - curl -X GET\&limit=1

All documents in the DB (as well as deleted ones):
  - curl -X GET

Now that I can do simple curl commands I think perhaps the next step
up would be JavaScript.

I dislike JavaScript so I tend to use jQuery when possible.

It appears that I can use jQuery to send GET, POST, PUT, and DELETE
requests to couchDB:


The above page states that some browsers don't support PUT and DELETE.

I think perhaps that if I have a problem with these bad-browsers I
could have the bad-browser use a POST to ask a rails server to
construct a PUT or DELETE which might then leverage the rest-client
rubygem to do the deed.

So, here are my questions:

1. Are any of you using JavaScript to send requests to couchDB?

2. Have you bumped into issues with "bad-browsers"?

3. Are any of you using jQuery.ajax to send requests to couchDB?

4. If yes, do you like jQuery.ajax?

5. Are any of you using the rest-client rubygem to create proper REST
requests using signals from browsers?


Today that is all I'm curious about; I might have more questions tomorrow.


View raw message