CouchDB Top Tip: Bulk Insertions
Posted by chadwik on February 23, 2011
If you are using OS X and cURL to interact with CouchDB, I highly recommend you use the –data-binary switch to bulk insert. I struggled with this for days. In other words, to post a JSON file named “helpdeskimport1.json” to database “helpdesk”, I would use the following command:
curl –data-binary @helpdeskimport1.json -H “Content-Type:application/json” -X POST http://localhost:5984/helpdesk/_bulk_docs -v
This should accommodate this version of curl:
curl 7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3
Run the the following command to check your version:
curl –version
Advertisement