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
{{ message }}
This repository was archived by the owner on Mar 18, 2021. It is now read-only.
join user's cards and sort users, by card's count. #935
hello
i have a usecase with this details:
a query on "User"s wich every users have many cards wich used by user.
question is here:
how can i sort user by his card's count.
You can not do that using the ORM at the moment and it would be a big undertaking for it to be implemented.
Also your query will be better described like that:
final cardQuery =Query<User>(context)
..where((u) => u.company).identifiedBy(companyId)
//..join(object: (u) => u.company) uncomment this row only if you want the company to be returned by the query
..join(set: (u) => u.card);
Activity
[-]sort data & join object[/-][+]join user's cards and sort users, by card's count.[/+]Reductions commentedon Jan 16, 2021
You can not do that using the ORM at the moment and it would be a big undertaking for it to be implemented.
Also your query will be better described like that:
bahramee commentedon Jan 16, 2021
thanks for fast answer.
i ask you for another help...
this is my current sorting progress:
can you help me please for optimize that ?
Reductions commentedon Jan 16, 2021
This is if you don't want to include the company rank:
Reductions commentedon Jan 16, 2021
This is if you want score: