As I understand the reduce function takes all the values of a particular key and we can write code to perform some kind of action on those values.
I do not understand what is the use of the rereduce parameter. Can somebody explain with an example?
Thanks…
I think http://wiki.apache.org/couchdb/Introduction_to_CouchDB_views#Reduce_vs_rereduce gives you an good overview. Due to performance optimations, the reduce function may be called on two levels:
In the second level, the parameter
rereduceistrue. For an example see http://wiki.apache.org/couchdb/Built-In_Reduce_Functions#A_sum. In the first step the length of the block (values) is returned, on the rereduce level these lengths must be summed up.