O'Reilly logo

Learning Couchbase by Henry Potsangbam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Custom reduce functions

Why do we need custom reduce functions? Sometimes, the built-in reduce function doesn't meet our requirements, although it will suffice most of the time.

Custom reduce functions allow you to create your own reduce function. In such a reduce function, output of map function goes to the corresponding reduce function group as per the key of the map output and the group level parameter. Couchbase ensures that output from the map will be grouped by key and supplied to reduce. Then it's developer's role to define logic in reduce, what to perform on the data such as aggregating, addition etc.

To handle the incremental MapReduce functionality (that is, updating an existing view), each function must also be able to handle and consume ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required