From 94afb193d8e0d4e93dccd0b45ba2b8c1c8939249 Mon Sep 17 00:00:00 2001 From: splatte Date: Sun, 7 Feb 2016 18:37:03 +0100 Subject: [PATCH] add flush functionality which deletes all documents from the bucket --- lib/couchie.ex | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/couchie.ex b/lib/couchie.ex index 9118274..eb211fb 100755 --- a/lib/couchie.ex +++ b/lib/couchie.ex @@ -123,6 +123,16 @@ defmodule Couchie do :cberl.remove(connection, key) end + @doc """ + Empty the contents of the specified bucket, deleting all stored data. + ## Example + + Couchie.flush(:connection) + """ + def flush(connection) do + :cberl.flush(connection) + end + @doc """ Delete document. Key should be binary. ## Example