Skip to content

How can I sort json_object inside json_group_array ? #3008

Answered by simolus3
chrg1001 asked this question in Q&A
Discussion options

You must be logged in to vote

How can I write the expression of OrderingTerm?

In the latest drift version, jsonGroupArray is part of the package and has an orderBy argument.

(Simply use leftJoin to get the data in one dimension, and then merge them on the Dart side?)

I think traditionally the way you'd write this is to first select the projects you're interested in. Then you collect their ids and run a second query filtering members and employees involved in that particular project. We have an example for that here. Using a single join to fetch everything and then filter out duplicates in the project columns would also work.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@chrg1001
Comment options

@simolus3
Comment options

@chrg1001
Comment options

Answer selected by chrg1001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants