// builder like this findOneAndUpdate<T = any>(repository: Repository<Model<T, T>>, data: Record<string, any>, options: FindOptions<any>) { let repositoryModel: Model<T, T> = await repository.findOne(options) repositoryModel = Object.assign(repositoryModel, { ...data }) return (await repositoryModel.save(options)).dataValues } // call builder like this this.findOneAndUpdate<Remittances>(this.remittanceModel, data, { where: { id: checkRemittanceExist.id }, transaction: t, }) .then((res: Remittances) => res)async function updateOrCreate (model, where, newItem) { // First try to find the record const foundItem = await model.findOne({where}); if (!foundItem) { // Item not found, create a new one const item = await model.create(newItem) return {item, created: true}; } // Found an item, update it const item = await model.update(newItem, {where}); return {item, created: false}; } Project.update( { title: 'a very different title now' }, { where: { _id: 1 } } )Your_model.update({ field1 : 'foo' },{ where : { id : 1 }}); Your_model.update({ field1 : 'bar' },{ where : { id : 4 }});await Project.update( { title: 'a very different title now' }, { where: { _id: 1 } } );const objectToUpdate = { title: 'Hello World', description: 'Hello World' } models.Locale.update(objectToUpdate, { where: { id: 2}}) const objectToUpdate = { title: 'Hello World', description: 'Hello World' } models.Locale.findAll({ where: { title: 'Hello World'}}).then((result) => { if(result){ // Result is array because we have used findAll. We can use findOne as well if you want one row and update that. result[0].set(objectToUpdate); result[0].save(); // This is a promise } }) models.User.destroy({where: {userID: '유저ID'}}) .then(result => { res.json({}); }) .catch(err => { console.error(err); });var Book = db.define(‘books’, { title: { type: Sequelize.STRING }, pages: { type: Sequelize.INTEGER } }) Book.update( {title: req.body.title}, {where: req.params.bookId} )