LET docs = [ { tags: [ "foo", "bar" ] }, { tags: [ "foo", "zaz" ] }, {
tags: [ "fab", "zaz" ] } ]
RETURN UNIQUE(
FOR doc IN docs
FOR tag IN doc.tags
RETURN tag
)
or
LET docs = [ { tags: [ "foo", "bar" ] }, { tags: [ "foo", "zaz" ] }, {
tags: [ "fab", "zaz" ] } ]
RETURN UNIQUE(
(FOR doc IN docs RETURN doc.tags)[**]
)
Am Dienstag, 10. Januar 2017 16:49:40 UTC+1 schrieb [email protected]:
>
> Hi
>
> I've the following model,
>
> doc1 ->
> {
> ...,
> tags : ["foo", "bar"]
> ...
> }
>
>
> doc2 ->
> {
> ...,
> tags : ["foo", "zaz"]
> ...
> }
>
> doc3 ->
> {
> ...,
> tags : ["fab", "zaz"]
> ...
> }
>
> how to return the distinct tags as follows ["foo", "bar", "fab", "zaz"] ?
>
>
>
--
You received this message because you are subscribed to the Google Groups
"ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.