Answer the question
In order to leave comments, you need to log in
Sequelize (PostgreSQL) alias on update?
Hello. Please tell me how to do it on Sequelize using the PostgreSQL database, when updating for the returned fields, you need to make alias.
UPDATE "Cartridges" SET "quantity" = 50 WHERE "id" = 2 returning id, code as codeCartridge
const cartridge = await models.Cartridge.update( { quantity }, { returning: true, where: { id } } );
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question