Answers for "sequelize get where match string"

0

sequelize like search

const Sequelize = require('sequelize');
const Op = Sequelize.Op;

let data: Array<any> = await MyDataSequelizeAccess.findAll({
  where: {
    name: {
      [Op.like]: '%Bob%'
    }
  }
});
Posted by: Guest on March-16-2020
3

sequelize find one

const project = await Project.findOne({ where: { title: 'My Title' } });
if (project === null) {
  console.log('Not found!');
} else {
  console.log(project instanceof Project); // true
  console.log(project.title); // 'My Title'
}
Posted by: Guest on February-09-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language