nodejs:sequelize数据库查询的Op方法

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:以结束 [Op.endsWith]: 'm'

eq:= 等于 [Op.eq]: 12

gt:> 大于 [Op.gt]: 6

gte:>= 大于等于 [Op.gte]: 6

iLike:

in:查询包含的状态 [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:查询不包含的状态 [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:


©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容