You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to get all pages of a specific showplace.
What is actually happening?
But the output includes all of my pages! In some of output items pageShowPlaces is an empty (items that should NOT be in output) array and in the others "pageShowPlaces" is OK (correct items that must be in output)
SELECT "page"."id", "page"."title"
FROM "page" AS "page"
LEFT OUTER JOIN
(
"pageShowPlace" AS "pageShowPlaces"
INNER JOIN "showPlace" AS "pageShowPlaces->showPlace"
ON "pageShowPlaces"."showPlaceId" = "pageShowPlaces->showPlace"."id"
AND "pageShowPlaces->showPlace"."id" = 2
)
ON "page"."id" = "pageShowPlaces"."pageId";
BUT It should be something like this:
SELECT "page"."id", "page"."title"
FROM "page" AS "page"
LEFT OUTER JOIN "pageShowPlace" AS "pageShowPlaces"
ON "page"."id" = "pageShowPlaces"."pageId"
LEFT OUTER JOIN "showPlace" AS "pageShowPlaces->showPlace"
ON "pageShowPlaces"."showPlaceId" = "pageShowPlaces->showPlace"."id"
WHERE "pageShowPlaces->showPlace"."id" = 2;
I expect to just get the last item in output, because the first two items are wrong
note: I've search stackoverflow and sequelize documentation but nothing found,
I've also tried to put where in the root of query with many way but it has'nt worked...
The text was updated successfully, but these errors were encountered:
What are you doing?
I have 3 model:
Page, PageShowPlace, ShowPlace
Actually 'PageShowPlace' is an junction table to make many to many relation between Page and ShowPlace.
Here is my association codes:
What do you expect to happen?
I wanted to get all pages of a specific showplace.
What is actually happening?
But the output includes all of my pages!
In some of output items pageShowPlaces is an empty (items that should NOT be in output) array and in the others "pageShowPlaces" is OK (correct items that must be in output)
Sequelize create query bellow:
BUT It should be something like this:
I expect to just get the last item in output, because the first two items are wrong
Sequelize version: ^4.32.2
Pg version: ^6.4.2
__pg-hstore version: ^2.3.2
note: I've search stackoverflow and sequelize documentation but nothing found,
I've also tried to put where in the root of query with many way but it has'nt worked...
The text was updated successfully, but these errors were encountered: