Filter view result keys using wildcard
Mon, 05/21/2012 - 12:14
Is there a way to filter view result keys using wildcards? For example something like "Get all keys that start with 'cid_10_'" -> key="cid_10_*".
Similarly, can I use the key or keys parameters to filter 2-element array keys based on one of the elements of the key? For example if the resulting keys are:
["1", "1"], ["1", "2"], ["1", "3"], ["1", "4"], ["1", "5"], ["2", "1"], ["2", "2"], ["2", "3"], ["2", "4"], ["2", "5"],
with some values, to be able to get all the values that have "1" as the first element of the key or in the above example:
["1", "1"], ["1", "2"], ["1", "3"], ["1", "4"], ["1", "5"],
I think I kind of answered my own questions.
For the first part there are apparently the startkey and endkey parameters, which I had somehow missed.
For the second part instead of using array keys I should just concatenate the 2 elements using something sort of separator and get keys of the type 1::1, 1::2, 2::4, etc. Then I could use the startkey and endkey once again