Select distinct of array of string

we have a predicate:

tags: [string] @index(term) .

how do we select distinct of all tags from all records?
it cannot be duplicate even thou 1st record may contains 2 tags that may contains in another record.
we want the record to return list of string with unique tags
and even, is it possible to sort them after getting the list?

I have a gist with similar examples see what you can get from it GetIssues_Customer_By_metaTags.YML · GitHub

in the example I explore more the use of Tags by String.

If you wanna unique tags use tags: uid @reverse . But with string you can do it too, but you have to do checks to make sure that all strings are unique. Like Upsert Procedure.

I believe tags by UID (nodes) are better because you can see the relation visually. And do “count” more directly.

hi @MichelDiz,

do you meant that i would have insert string of any value to be stored as uid?

I don’t get this statement. Strings/int/date/any are not converted to UIDs. What I meant is that your tags could be Nodes.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.