[5.0] Lucid Query With Distinct & OrderBy #1828
-
Hello guys, I'm trying to get the latest (distinct by manga) chapter of manga oderned by created_at. //relationship:
manga -> hasMany(chapter)
chapter -> belongsTo(manga) the code: const latestMangaUpdates: Array<Chapter> = await Chapter.query()
.orderBy('created_at', 'desc')
.distinct('manga_id')
.limit(24)
.preload('manga') and getting this error: Sorry if my explanation was not clear, English is not my native language. So how would this query be using lucid? |
Beta Was this translation helpful? Give feedback.
Answered by
hariprasath-yadav
Nov 3, 2020
Replies: 1 comment
-
use like
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
lsfratel
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
use like