在没有咨询的情况下进行Estoy庄园将utilizando sequelize.query()进行续集。科莫波多黎各人像歌剧院一样喜欢单身男女的狂欢
sequelize.query('(..) WHERE LOWER(u.NOMBRE) LIKE "LOWER(:find)%" AND u.ACTIVO = 1 ', {replacements: {find: req.params.usuario, id: req.session.passport.user}, type: sequelize.QueryTypes.SELECT})
答案 0 :(得分:0)
根据您的问题如何使用$ like的示例:
const Sequelize = require('sequelize');
const Op = Sequelize.Op;
const user = User.findAll({ // or User.findOne
where: {
activo: 1, // your search condition
[Op.like]: [
{ nombre: req.params.nombre } // your $like params
],
}
attributes: ['id', 'nombre'] // results you want returned
})