1const Op = Sequelize.Op;
2
3app.get('/notes/search', function(req, res) {
4 Note.findAll({
5 limit: 2,
6 where: {
7 tag: {
8 [Op.or]: [].concat(req.query.tag)
9 }
10 }
11 }).then(notes => res.json(notes));
12});
13
1const Sequelize = require('sequelize');
2const Op = Sequelize.Op;
3
4let data: Array<any> = await MyDataSequelizeAccess.findAll({
5 where: {
6 name: {
7 [Op.like]: '%Bob%'
8 }
9 }
10});
11
1 exports.getMinPrice = () => Item.findAll({ attributes: [[sequelize.fn('min', sequelize.col('price')), 'minPrice']], });