📜  sequelize 分页 postgres - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:14.653000             🧑  作者: Mango

代码示例1
const limit = 10;
const offset = (req.body.page - 1) * limit;

const result = await Posts.findAndCountAll({
  offset: offset,
  limit: limit,
  order: [
    ['date', 'ASC']
  ]
});