orderBy in nested findMany
The docs suggest that I can order a nested findMany (https://orm.drizzle.team/docs/rqb#order-by)
Like so:
But when I attempt to do something similar:
I get the type error :
Object literal may only specify known properties, and orderBy does not exist in type
How can I orderBy an attribute in a nested query? The projectInfo is a one-to-one relation with projects. I want to order projects by projectInfo.name? Is there a way I can do this using the query
syntax?Drizzle ORM - Query
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
1 Reply
Hello @tomhill! As for now, you can't filter/order
projects
in nested relations using query syntax. All filters and etc. will be applied to relations, not to the parent (in your case projects
).
Also, you face error because you can't order/filter in one-to-one
relations