From d0d5eec199b0ccedb2935877be8e5cdf687b047b Mon Sep 17 00:00:00 2001 From: Igal Koshevoy Date: Sun, 15 Nov 2009 23:15:20 -0800 Subject: [PATCH] Added CouchRest::Database#bulk_save_doc and #batch_save_doc as human-friendlier wrappers around #save_doc. --- lib/couchrest/core/database.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/couchrest/core/database.rb b/lib/couchrest/core/database.rb index 7ddd16a..547e35c 100644 --- a/lib/couchrest/core/database.rb +++ b/lib/couchrest/core/database.rb @@ -189,6 +189,15 @@ module CouchRest result end + # Save a document to CouchDB in bulk mode. See #save_doc's +bulk+ argument. + def bulk_save_doc(doc) + save_doc(doc, true) + end + + # Save a document to CouchDB in batch mode. See #save_doc's +batch+ argument. + def batch_save_doc(doc) + save_doc(doc, false, true) + end # POST an array of documents to CouchDB. If any of the documents are # missing ids, supply one from the uuid cache.