oreilly / couchdb-guide

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

Bulk Docs upload needs an example #437

Open pulkitsinghal opened 13 years ago

pulkitsinghal commented 13 years ago

In order to make the following section more consumable/actionable: http://guide.couchdb.org/draft/performance.html#bulk

I think that something as simple as the following set of instructions will go a really long way:

1) To try a bulk upload from command-line run: curl -d '{"docs":[{"key":"baz","name":"bazzel"},{"key":"bar","name":"barry"}]}' -X POST http:/127.0.0.1:5984/yourDbName/_bulk_docs

2) To try a bulk upload from a file, make sure to edit the json file such that it has {"docs":[ in the starting and ]} in the ending, then you may run: curl -d @your_file.json -X POST http:/127.0.0.1:5984/yourDbName/_bulk_docs

olupotd commented 10 years ago

try this in your terminal

DB="http://username:passwd@serverurl:port/databasename"

curl -d @list.json -H "Content-Type:application/json" -X POST $DB/_bulk_docs

Specify the content type as well just incase

hellboy81 commented 9 years ago

What is "docs"?