Guest User

Untitled

a guest
Feb 22nd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. sites = await Site.findAll({
  2. where: {
  3. [Op.or]: [
  4. 'title', 'site_url', 'tags'
  5. ].map(key => ({
  6. [key]: {
  7. [Op.like]: `%${search}%`
  8. }
  9. }))
  10. }
  11. });
  12.  
  13. SELECT * FROM `Sites` AS `Site` WHERE (`Site`.`title` LIKE '%min%'
  14. OR `Site`.`site_url` LIKE '%min%' OR `Site`.`tags` LIKE '"%min%"');
Add Comment
Please, Sign In to add comment