How do I upload JSON data to Cloudant in bulk?

Viewed 70

I'm trying to upload a 50Mb json file to a Cloudant database and I've tried over curl and using a NodeJS script. I get 

{"error":"too_large","reason":"the request entity is too large"}

but if I limit it to 1000 documents, it works.What is the fastest way of doing this , am I missing something? 

1 Answers

Cloudant has a document size limit of 1MB and each individual request must be less than 10MB. So if you need to upload 50MB of data, the work needs to be distributed amongst several API calls. I would recommend you use the _bulk_docs API to upload 500 documents per API call. You may have several API calls in flight at any one time.

Related