lib/fluent/plugin/out_couch.rb in fluent-plugin-couch-0.1.5 vs lib/fluent/plugin/out_couch.rb in fluent-plugin-couch-0.2.0
- old
+ new
@@ -78,15 +78,14 @@
record.to_msgpack
end
def write(chunk)
records = []
- chunk.msgpack_each {|record|
- records << record
- }
- #TODO: bulk insert
- for record in records
- @couch.post(@database,record.to_json)
- end
+ chunk.msgpack_each {|record| records << record }
+ @couch.post(@database+'/_bulk_docs', {"all_or_nothing"=>true, "docs"=>records}.to_json)
+
+ #for record in records
+ # @couch.post(@database,record.to_json)
+ #end
end
end
end