I want to administrate my User-entities in a grid. I want to sort them and I want to have a search filter for each column.
My dynamic generated temporary view works fine:
function(doc){
if(doc.type === 'User' &&
// Dynamic filters: WHERE firstName LIKE '%jim%' AND lastName LIKE '%knopf%'
(doc.firstName.match(/.*?jim.*?/i) &&
doc.lastName.match(/.*?knopf.*?/i)) ) {
// Dynamic sort
emit(doc.lastName, doc);
}
}
BUT everywhere is written you have to AVOID temporary views. IS there a better way? Should I save these searches on demand at runtime?
Thanks