Commits

Gabriel Farrell  committed 03e2b54

More copy edits

  • Participants
  • Parent commits 29f0b4c

Comments (0)

Files changed (1)

File code4lib13/isis2couchdb.txt

 
 Nearly every task which can be done via Futon can also be automated using the
 RESTful API of CouchDB via cURL, a command-line HTTP client available for many
-systems. In fact, interacting with CouchDB is a great way to learn, in practice,
-what REST and RESTful interfaces are all about. For example, creating a database
-is done with a PUT request:
+systems. In fact, interacting with CouchDB is a great way to learn, in
+practice, what REST and RESTful interfaces are all about. For example, a
+database is created with a PUT request:
 
 <pre>
 $ curl -X PUT http://admin_user:password@127.0.0.1:5984/lilacs
 </pre>
 
-One operation which that can only be done using cURL or some custom built HTTP
-client is a bulk upload or records. Continuing the previous example, we could
-convert an ISO-2709 file to JSON, and then upload it to CouchDB in two steps:
+One operation that can only be done using cURL or a custom-built HTTP client is
+a bulk upload of records. Continuing the previous example, we could convert an
+ISO-2709 file to JSON, then upload it to CouchDB in two steps:
 
 <pre>
 $ ./isis2json.py cds.iso -c > cds1.json
 advantage of two cores with a simple shell script like this one:
 
 <pre>
-  #!/bin/bash
-  isis2json.py -c -p v -i 2 -q 10000 lilacs100k.iso | \
-  curl -d @- -H"Content-Type: application/json" \
-       -X POST http://127.0.0.1:5984/lilacs/_bulk_docs &
-  isis2json.py -c -p v -i 2 -q 10000 -s 10000 lilacs100k.iso | \
-  curl -d @- -H"Content-Type: application/json" \
-       -X POST http://127.0.0.1:5984/lilacs/_bulk_docs
+#!/bin/bash
+isis2json.py -c -p v -i 2 -q 10000 lilacs100k.iso | \
+curl -d @- -H"Content-Type: application/json" \
+     -X POST http://127.0.0.1:5984/lilacs/_bulk_docs &
+isis2json.py -c -p v -i 2 -q 10000 -s 10000 lilacs100k.iso | \
+curl -d @- -H"Content-Type: application/json" \
+     -X POST http://127.0.0.1:5984/lilacs/_bulk_docs
 </pre>
 
 If an _id attribute is not present in an inserted document, CouchDB provides
-one, filled with an UUID (Universally Unique Identifier) like
+one, filled with a UUID (Universally Unique Identifier) like
 "ead3af23a4459b2d7a1aef05cb0012a9". It is highly recommended that an _id is
 given when adding documents to prevent inadvertent duplication of records if a
 bulk loading process is interrupted and restarted. Therefore isis2json.py