The solution which works for me is this:-
// here startDate and endDate are Date objects
const where = {
from: {
$between: [startDate, endDate]
}
};
For reference to know more about operators:- http://docs.sequelizejs.com/en/latest/docs/querying/#operators
Note:
In MYSQL between comparison operator is inclusive, which means it is equivalent to the expression (startDate <= from AND from <= endDate).