[[Source File on GitHub|https://github.com/basho/riak_function_contrib/blob/master/mapreduce/erlang/delete_key.erl]]
This Erlang reduce function will delete bucket and key pairs passed to it from a map phase. The result of the function is the number of keys deleted during the reduce phase.
```erlang
-module(reduce_functions).
-export([delete/2]).
% Data is a list of bucket and key pairs, intermixed with the counts of deleted
% objects. Returns a count of deleted objects.
delete(List, None) →
{ok, C} = riak:localclient(),
```