Hi Carl,
> Whats the best approach for excluding documents from a view based on a list of regex
expressions. For example I want to exclude anything where doc.issue.name contains a value
that matches a list of regex expressions.
> e.g. exclusion list: [/foo/, /bar/]
I am not sure what is the best approach to do that.
For your example, you could have done:
function(o) {
switch (o.issue.name) {
case "foo":
case "bar": break;
default: emit(o.issue.name, null)
}
}
The pros is that you can add other exclude values very easily. But it only works with strings.
If you need real regexes, I suppose you will need to build one huge regex containing them
all.
Regards,
Aurélien
|