I am using Sequelize with sqlite3, but I'm having problems querying data based on date type columns.
Here is my model definition:
var sensorData = sequelize.define('Data',
{
time: Sequelize.DATE,
value: Sequelize.FLOAT,
type: Sequelize.STRING,
source: Sequelize.STRING
},
{
timestamps : false
});
Now I want to get all records with "time" after a certain time in this function:
function selectData(start_date, num_of_records, callback)
{
sensorData.findAll({
limit: num_of_records,
where: [time, '???'], <====== How to specify the condition here?
order: 'time'}).success(callback);
}
I cannot find anything on the Sequelize website about requesting a query based on date type.
Any idea?
source
share