Categories
JavaScript Answers

How to create or update with Node Sequelize?

Spread the love

To create or update with Node Sequelize, we use the upsert method.

For instance, we write

User.upsert({ a: "a", b: "b", username: "john" });

to call upsert with an object with the value to create or update.

It’ll look for the item to update by the primary key.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *