Chad(wik)’s Musings…

A Georgia Tech student on development and IT management

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.