Union
Union( group, ... )
Examples
The following query combines the Set Reference returned by
locating the search term "fire" in the index named "spells_by_element"
and the Set Reference returned by locating the search term
"water" in the index named "spells_by_element". The Paginate
function materialized the results of the Union
operation into a
Page.
{
data: [
Ref(Collection("spells"), "181388642046968320"),
Ref(Collection("spells"), "181388642071085568"),
Ref(Collection("spells"), "181388642088911360")
]
}
The following query is similar to the example above, but it returns document events instead of the index tuples.
{
data: [
{
ts: 1592112265440000,
action: 'add',
document: Ref(Collection("spells"), "181388642046968320")
},
{
ts: 1592112265440000,
action: 'add',
document: Ref(Collection("spells"), "181388642071085568")
},
{
ts: 1592112265440000,
action: 'add',
document: Ref(Collection("spells"), "181388642088911360")
}
]
}
The following query demonstrates how various arrays are evaluated:
[ [ 'A', 'B', 'C', 'D' ],
[ 'A', 'B', 'C' ],
[ 'A', 'B', 'C', 'D' ],
[ 'A', 'B', 'B', 'C' ] ]
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!