Querybuilder help
Unanswered
Pip gall wasp posted this in #help-forum
Pip gall waspOP
Hello I am new here.
7 Replies
Pip gall waspOP
I got this query:
let seriesQuery = seriesRepository.createQueryBuilder("series");
seriesQuery = seriesQuery
.select([
"series.programTitle",
"series.seriesTitle",
])
let seriesQuery = seriesRepository.createQueryBuilder("series");
seriesQuery = seriesQuery
.select([
"series.programTitle",
"series.seriesTitle",
])
run as written, it would return say 100 times "game of thrones .. "
then I can say, seriesQuery = seriesQuery.distinctOn(["series.seriesTitle"])
but this distinct on would in this case apply only to entries who have a seriesTitle
and it would not apply to entries that have only a programTitle
A rudimentary solution would be to run two different queries and to glue their result into a one API call
is it possible to do it?