oreilly / couchdb-guide

CouchDB: The Definitive Guide
http://guide.couchdb.org/
501 stars 139 forks source link

Bulk updates with curl require --data-binary instead of the -d switch #382

Closed chadc closed 13 years ago

chadc commented 13 years ago

Using the following version of curl: curl 7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3

The "-d" switch referenced in Couch API/Documentation does not properly bulk-insert .JSON files and results in an "invalid JSON" error message. To remedy, supplying curl with the "--data-binary" switch works.

Example of a successful POST command:

curl –data-binary @helpdeskimport1.json -H “Content-Type:application/json” -X POST http://localhost:5984/helpdesk/_bulk_docs -v