sequelize-typescript icon indicating copy to clipboard operation
sequelize-typescript copied to clipboard

Update method with where options

Open jsanz1209 opened this issue 3 years ago • 0 comments

Hi everyone!

I'm trying to update and delete one row of a specific table, but I don't know if the syntaxis that I'm using is correct.

For example for destroying I coded the next one:

.model.destroy({ where: { "ReqID": id } as any } });

The transaction is completed, but I've observed the syntaxis inside where clause is not correct, for this reason I'm using "as any" inside where.

How is the correct syntaxis then? I've tried with:

model.destroy({ where: { attribute: { "ReqID": id } } });

but without success.

Can someone help with this?

Thanks in advance

jsanz1209 avatar Sep 06 '22 19:09 jsanz1209