I need to make a view that emits a value for each pair of documents (A cartesian product of _all_docs with itself)
For example, assume DB has documents with IDs a
, b
, c
-> then the view should emit 9 keys aa
, ab
, ac
, ba
, ... , cc
(assuming no grouping)
E.g. if the documents are "cities" with coordinates, the view returns pairs of cities and distance between them (real example is more complicated), so I could then use _list
function to compute "top10 closest cities" and so on.
This looks like a very simple task, however Google and SO search gives no results. Am I missing some magic keyword here?