M
M
Michael2018-08-07 14:42:17
Node.js
Michael, 2018-08-07 14:42:17

How to correctly compose a query with the ADDDATE function in sequelize?

Hello. I work with MySQL through sequelize. I can't figure out how to correctly call the update method. The request is like this:

update plants
set last_date = ADDDATE(last_date, period)
where name = 'ромашки' and user_id = 10

In sequelize it should be something like this:
Plants.update({
   where: {
       name: 'ромашки',
       user_id: '10'
   },
   //как тут задать функцию со значением столбца в качестве аргумента???
})

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2018-08-07
@mak_ufo

how to set a function

sequelize.col

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question