let Sequelize = require('sequelize');
const op = Sequelize.Op;
op方法:
adjacent: 鄰近的 [Op.adjacent]: [1, 2]
all:所有 [Op.gt]: { [Op.all]: literal('SELECT 1') }
and:并且 [Op.and]: {a: 5}
any:任意 [Op.any]: [2,3]
between:之間 [Op.between]: [10, 20]
col:
contained:
contains:
endsWith:以結(jié)束 [Op.endsWith]: 'm'
eq:= 等于 [Op.eq]: 12
gt:> 大于 [Op.gt]: 6
gte:>= 大于等于 [Op.gte]: 6
iLike:
in:查詢包含的狀態(tài) [Op.in]: [12, 25]
iRegexp:
is:是否堂鲜,判斷類 [Op.is]: null
like:模糊匹配贷岸,包含 [Op.like]: '%m%'
lt:< 小于 [Op.lt]: 23
lte:<= 小于等于 [Op.lte]: 10
ne:!= 不等于 [Op.ne]: 23
noExtendLeft:
noExtendRight:
not:非查詢 [Op.not]: null
notBetween:不在xx和xx之間的 [Op.notBetween]: [11, 23]
notILike:
notIn:查詢不包含的狀態(tài) [Op.notIn]: [12, 25]
notIRegexp:
notLike:模糊匹配欠肾,不包含 [Op.notLike]: '%m%'
notRegexp:正則,不以開始 [Op.notRegexp]: '^[h|a|t]'
or:或者 where:{ [Op.or]:[ {parent_id:id}, {id:id} ] }
overlap:重疊部分 [Op.overlap]: [1, 2]
placeholder:占位符
regexp:正則堡距,以開始 [Op.regexp]: '^[h|a|t]'
startsWith:字符串债朵,以*開始 [Op.startsWith]: 'j'
strictLeft:
strictRight:
substring:模糊匹配 [Op.substring]: 'oh'
values: