All you need is a web app (or even static HTML file) that will:
- Load up one of your documents that you would like to map in the browser. Since the documents are JSON, this is easy. In our project, we have JSON fixture files and a small web app that allows you to choose which fixture to use for testing.
- Mock the emit() method. You can just have it write to a Hash that you can inspect later.
- Load up the Map and Reduce functions. If you keep these in separate .js files, you can pull them in with a simple script tag.
- Put a link on the page that will let you run the bound function.
This will emulate the MongoDB MapReduce environment, but you can now use the browser's debugging tools.