sequelize
query findone
can return the first matched data
then I want to get the last matched data. Is there a convenient way to
or findAll
to get all the data and then get the last
sequelize
query findone
can return the first matched data
then I want to get the last matched data. Is there a convenient way to
or findAll
to get all the data and then get the last
//id
User.findAll({order:[['id', 'DESC']],limit:1})
something.findOne({
order: [
[sequelize.fn('max', sequelize.col('age')), 'DESC'],
]
})
the model, created by sequelize-cli modifies the foreign key associate hasMany and other relationships, how to Synchronize this foreign key relationship to the database? ...