# File lib/couchrest/database.rb, line 166 def bulk_save(docs = nil, use_uuids = true, all_or_nothing = false) if docs.nil? docs = @bulk_save_cache @bulk_save_cache = [] end if (use_uuids) ids, noids = docs.partition{|d|d['_id']} uuid_count = [noids.length, @server.uuid_batch_count].max noids.each do |doc| nextid = @server.next_uuid(uuid_count) rescue nil doc['_id'] = nextid if nextid end end request_body = {:docs => docs} if all_or_nothing request_body[:all_or_nothing] = true end CouchRest.post "#{@root}/_bulk_docs", request_body end