var conditionalData = {
id: {
$Between: [11, 15]
},
technician_id: technicianId
};
var attributes = ['id', 'service_start_time', 'service_end_time'];
userServiceAppointmentModel.findAll({
where: conditionalData,
attributes: attributes
}).complete(function (err, serviceAppointmentResponse) {
if (err) {
var response = constants.responseErrors.FETCHING_DATA;
return callback(err, null);
} else {
if (serviceAppointmentResponse.length > 0) {
var response = constants.responseErrors.NO_AVAILABLE_SLOTS_IN_YOUR_CALENDAR;
return callback(response, null);
}
}
);
When I run the above query it gives me error as
"message": "ER_SP_DOES_NOT_EXIST: FUNCTION user_service_appointment.id does not exist"
$Between should be $between.
If you are using an older version of sequelize, you may need to remove the $ too
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With