couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McDaniel <couch...@autosys.us>
Subject Re: bulk insert
Date Sun, 15 Nov 2009 22:30:38 GMT
On Sun, Nov 15, 2009 at 04:43:15PM -0500, Robert Recchia wrote:
> I have been playing couchdb for about 2 weeks now.  I'm having trouble
> dealing with how to perform a bulk insert.
> Is it possible to perform a bulk insert with a json file.  So lets say
> i have a json file with all my documents that i want to insert what is
> the syntax to insert them in bulk.  I have a db named albums with all
> my favorite album names and the groups they are sung by.  How does
> everyone else deal with bulk inserts.
> 
> -- 
> Robert Recchia

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
curl -vX POST --data @/tmp/short_post.txt  http://localhost:5984/test_db/_bulk_docs

where short_post.txt looks like

{ "docs" : [ 
{ "name" : "test_a" , "date" : "Sun Jan 4, 2008" , "place" : "Portland" } ,
{ "name" : "test_b" , "date" : "Sun Jan 4, 2008" , "place" : "Portland" } ,
{ "name" : "test_c" , "date" : "Sun Jan 4, 2008" , "place" : "Portland" }
] }





~Michael

Mime
View raw message