I am experimenting with Union
and I got confused by the results its yielding.
This is my FQL code:
Let(
{
h264: Match(Index("VideoUpload_preset_status"), ["h264", "DONE"]),
h265: Match(Index("VideoUpload_preset_status"), ["h265", "DONE"]),
vp9: Match(Index("VideoUpload_preset_status"), ["vp9", "DONE"])
},
Union(Var("h264"), Var("h265"), Var("vp9"))
)
Which produces:
{
"@set": {
union: [
{
"@set": {
match: Index("VideoUpload_preset_status"),
terms: ["h264", "DONE"]
}
},
{
"@set": {
match: Index("VideoUpload_preset_status"),
terms: ["h265", "DONE"]
}
},
{
"@set": {
match: Index("VideoUpload_preset_status"),
terms: ["h265", "DONE"]
}
},
{
"@set": {
match: Index("VideoUpload_preset_status"),
terms: ["vp9", "DONE"]
}
}
]
}
}
Please notice that h265
appears twice in the results. Why?
If I run the same code but without Union
it returns an array with only 3 objects, as expected.