【发布时间】:2016-10-07 13:57:36
【问题描述】:
我的表中有一个新创建的列,我需要在我的一个服务器控制器中进行查询。此列中的数据将是 JSON 类型并命名为“元”。完成后会是这个样子
{
"audit": {"date": 1465311598315, "user": 20191932891}
}
目前,此表中的所有条目都有一个空 JSON 列,其值为 NULL。
在我的一个服务器控制器中,我需要获取 meta 为 null 或 meta.audit.date 超过 90 天的所有条目。我的查询看起来像这样
db.Question.findAll({
where: {
status: 'active',
PassageId: {
$eq: null
},
meta: {
audit: {
date: {
$or: {
$lte: threeMonthsAgo,
$eq: null
}
}
}
}
}
});
在这种情况下,三个月前是三个月前的日期。
没有返回任何结果,我在控制台中收到此错误:
Unhandled rejection SequelizeDatabaseError: operator does not exist: text <= bigint
【问题讨论】:
标签: node.js postgresql sequelize.js