---
title: "MapReduce related patterns"
date: 2011-09-26
description: "Here’s a list of possible MapReduce related patterns I’ve been thinking about:\nmap-update: update each mapped document and emit its updated or original version; map-delete: delete each mapped …"
---


Here's a list of possible MapReduce related patterns I've been thinking about:

- _map-update_: update each mapped document and emit its updated or original version;
- _map-delete_: delete each mapped document;
- _map-reduce-map_: map results of a _map-reduce_;
- _map-map_: map results of a _map_;
- _map-recurse_: apply recursion to the mapping function until a stop condition occurs;
- any combination of patterns, e.g., _map-reduce-map-update_.

Example usage:

- get the e-mail address of every customer with a negative balance: _map-reduce-map_. First, _map-reduce_ to get the aggregate balance for each customer, then _map_ again to get only customers with negative value and emit their e-mail address;
- delete all documents older than one month: _map-delete_. First, _map_ to get all documents older than one month and then _delete_ each one;
- get a list of documents and mark them as read: _map-update_. First, _map_ to get the list of documents according to a given criteria, then _update_ each document marking it as read;
- and so on...
