Search also a Card's Custom Fields

This commit is contained in:
Pedro Sousa 2020-04-03 16:23:48 +01:00
parent 1e0b53eb9b
commit 6e86292b99
2 changed files with 6 additions and 2 deletions

View file

@ -806,7 +806,11 @@ Boards.helpers({
if (term) {
const regex = new RegExp(term, 'i');
query.$or = [{ title: regex }, { description: regex }];
query.$or = [
{ title: regex },
{ description: regex },
{ customFields: { $elemMatch: { value: regex } } },
];
}
return Cards.find(query, projection);