I have a newly created column in my table I need to query in one of my server controllers. This data in this column will be of JSON type and is named "meta". It will look something like this when completed
{
"audit": {"date": 1465311598315, "user": 20191932891}
}
currently all of the entries in this table have the empty JSON column with a NULL value.
In one of my server controllers I need to grab all entries where where meta is null or meta.audit.date is more than 90 days old. My query looks something like this
db.Question.findAll({
where: {
status: 'active',
PassageId: {
$eq: null
},
meta: {
audit: {
date: {
$or: {
$lte: threeMonthsAgo,
$eq: null
}
}
}
}
}
});
In this case three months ago is the date three months ago as a number.
No results are being returned and I get this error in my console:
Unhandled rejection SequelizeDatabaseError: operator does not exist: text <= bigint