Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sites = await Site.findAll({
- where: {
- [Op.or]: [
- 'title', 'site_url', 'tags'
- ].map(key => ({
- [key]: {
- [Op.like]: `%${search}%`
- }
- }))
- }
- });
- SELECT * FROM `Sites` AS `Site` WHERE (`Site`.`title` LIKE '%min%'
- OR `Site`.`site_url` LIKE '%min%' OR `Site`.`tags` LIKE '"%min%"');
Add Comment
Please, Sign In to add comment