-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Labels
type: bugDEPRECATED: replace with the "bug" issue typeDEPRECATED: replace with the "bug" issue type
Description
What you are doing?
I compare time range with inclusive bounds.
let range = [
data.period[0],
data.period[1]
]
range.inclusive = true
const d = await model.findOne({
where: {
id: {
$ne: data.id
},
StudentId: data.Student.id,
TimePeriodId: data.TimePeriod.id,
WeekDayId: data.WeekDay.id,
level,
period: {
$overlap: range
}
}
})What do you expect to happen?
Query
SELECT "id", "period", "level", "studyYear", "order" FROM "AsSchedules" AS "AsSchedule" WHERE "AsSchedule"."id" != 0 AND "AsSchedule"."StudentId" = 507 AND "AsSchedule"."TimePeriodId" = 8 AND "AsSchedule"."WeekDayId" = 1 AND "AsSchedule"."level" = 1 AND "AsSchedule"."period" && '["2016-11-04 21:00:00.000 +00:00","2016-11-05 21:00:00.000 +00:00"]' LIMIT 1What is actually happening?
But receive
SELECT "id", "period", "level", "studyYear", "order" FROM "AsSchedules" AS "AsSchedule" WHERE "AsSchedule"."id" != 0 AND "AsSchedule"."StudentId" = 507 AND "AsSchedule"."TimePeriodId" = 8 AND "AsSchedule"."WeekDayId" = 1 AND "AsSchedule"."level" = 1 AND "AsSchedule"."period" && '["2016-11-04 21:00:00.000 +00:00","2016-11-05 21:00:00.000 +00:00")' LIMIT 1Property inclusive lost after code
options = Utils.cloneDeep(options);in findOne() function.
Dialect: postgres
__Database version: 9.6.3
__Sequelize version: 4.7.1
Metadata
Metadata
Assignees
Labels
type: bugDEPRECATED: replace with the "bug" issue typeDEPRECATED: replace with the "bug" issue type