gpt4 book ai didi

node.js - 如何在 Sequelize 中使用 between 运算符?

转载 作者:搜寻专家 更新时间:2023-11-01 00:32:00 24 4
gpt4 key购买 nike

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);
}
}
);

当我运行上面的查询时,它给我的错误是

"message": "ER_SP_DOES_NOT_EXIST: FUNCTION user_service_appointment.id does not exist"

最佳答案

$Between 应该是 $between

如果您使用的是 旧版本 的 sequelize,您可能还需要删除 $

关于node.js - 如何在 Sequelize 中使用 between 运算符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28689944/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com