Shows/service: search regex in title AND description
This commit is contained in:
parent
46232de7f0
commit
7a29130234
1 changed files with 4 additions and 1 deletions
|
|
@ -34,7 +34,10 @@ export class ShowsService {
|
|||
|
||||
async search(name: string) {
|
||||
const regex = new RegExp(name, 'i');
|
||||
return this.showModel.find({ title: { $regex: regex } });
|
||||
const filter = {
|
||||
$or: [{ title: { $regex: regex } }, { description: { $regex: regex } }],
|
||||
};
|
||||
return this.showModel.find(filter);
|
||||
}
|
||||
|
||||
async update(id: string, dto: ShowDto): Promise<any> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue