Question

I'm working on a nodejs application and am inserting two attachments to a couchdb with cradle. Currently I am inserting the first attachment, getting the updated doc, and then inserting the second attachment with the updated _rev key. This is inefficient causing me to have to make two separate calls to couchdb.

Is there a way to create multiple attachments with a single cradle call?

Was it helpful?

Solution

CouchDB supports creating multiple attachments at once, See http://docs.couchdb.org/en/latest/api/document/common.html#creating-multiple-attachments for details. I don’t think cradle supports any of these, though, but I might be wrong. Should be easy to add and a good PR to send against cradle :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top