Adding a reduce
function to a view is surprisingly easy to do using Futon.
1. Open your browser and go to the
verge
database in Futon (http://localhost:5984/_utils/database.html?verge
).2. Click on the view drop-down box, and you'll see the application (the name of our design document). You can click on the view called
posts_by_user
.3. Click on View Code, so that you can see the text areas for Map and Reduce.
4. Enter
_count
into the Reduce text area, and click on Save.5. You can verify that your
reduce
function is working properly by clicking on the Reduce checkbox right below the Save button.