const Sequelize = require('sequelize'); const Op = Sequelize.Op; User.findAll({ raw: true, order: [ ['name', 'DESC'] ], // 排序 where: { // name: 'cheny', // 精確查詢 mobile_no: { // 模糊查詢 [Op.like]:'%' +mobile_no + '%' } }, attributes:['id','name'], // 控制查詢字段 })
中文參考:
https://github.com/demopark/sequelize-docs-Zh-CN
https://segmentfault.com/a/1190000011583806
egg、sequelize聯表查詢
https://blog.csdn.net/qq_30101131/article/details/79474905
.
