What's the most efficient way to compare 2 aggregates (set of vertices) and see if they contain the exact same results?
Using this doesn't seem to work:
.where(select('aggregate1').is(eq('aggregate2')))
aggregate1 and aggregate2 each one contains a bunch of vertices.
Evaluating equality of two sets should work, but they will both likely need to be ordered sets. Examples
... provides a match and returns ...
However, if I change the order of the second set, as in...
... then nothing gets returned (showing non-equivalence).
You would need to insert an
order(local)into the query to ensure the first set is ordered to match the second:Returns:
As an aside...
If looking for the difference between the two, you could use
where(within('x'))orwhere(without('x'))as a way to see the intersection or complement respectively.As an example using the airroutes dataset, if I wanted to find the common destination airports flying from MLI and ABE, I could use the following query:
Returns result:
If I wanted to see which destination airports are in one set but not the other, I could use:
Result: