Reduce data NoSQL


show more Reducing data provides you with in-depth training on Developer. Taught by Joseph LeBlanc as part of the Up and Running with NoSQL Databases show less
please wait ...

Reducing data

Sometimes you just want a summary of a particular dataset. Many NoSQL databases, including CouchDB, allow you to define a reduce function to do this on the server side. Let's navigate to the restaurant database. If you're not already at the All Documents view, go there. I've already loaded in several documents that we're going to apply a Map and a Reduce function to. These documents each represent an item that's going to be on the menu for the restaurant.

Each document has the name of the menu item as well as the category that that menu item belongs to. What I'd like to do with this data is create a reduce function to tell me how many items are in each category. Let's do this by going to the Temporary View. If you already have a function defined here for Map Function, you can just paste over it.

Now I am going to paste in the function and click Run. This Map Function is detecting whether or not the category property is set on the document. We're ...

Reducing data
Video duration: 3m 43s 56m 57s Intermediate

Viewers:

Reducing data provides you with in-depth training on Developer. Taught by Joseph LeBlanc as part of the Up and Running with NoSQL Databases

please wait ...