As you know, the reduce function in CouchDB views looks like this:
function (key, values, rereduce) { return sum(values); }
where the definition of the first arguments is as follows:
when rereduce is false , then:
- the key will be an array whose elements are arrays of the form [key, id], where the key is the key emitted by the map function, and the identifier is the document from which the key was generated.
- will be an array of values โโemitted for the corresponding elements in the keys.
My question is: when reereduce is false , are there any guarantees regarding the order of the elements in the key (or values ) array? The gut feeling (based on Reduce vs Rereduce ) is that keys and values โโmust be ordered accordingly, but I don't see any direct confirmation.
Any ideas? Thanks!
source share