我需要使用postgres日期函数在sequelize中应用where条件。以下是查询
where created_at between date_trunc('month', current_date) and date_trunc('month',
current_date)+'1month'
我试过这个
where:{user_id:user_id,created_at:{ [Op.between]: [[db.sequelize.literal('date_trunc(month, current_date)'),'test'],
[db.sequelize.literal('date_trunc(month, current_date)+1month'),'curr']]}}
如何通过提前使用sequelize ORM.Thanks来实现这一目标