sequelize findall limit code example
Example 1: sequelize limit
const Op = Sequelize.Op;
app.get('/notes/search', function(req, res) {
Note.findAll({
limit: 2,
where: {
tag: {
[Op.or]: [].concat(req.query.tag)
}
}
}).then(notes => res.json(notes));
});
Example 2: sequelize .all()
yourTableModel.findAll({
//optional filters
where: {},
raw: true,
})
Example 3: SEQUELIZE OR
"SELECT * FROM Student WHERE LastName='Doe' OR FirstName in ("John","Jane") OR Age>18"