Confusing behavior of `select()`.
The following traversal acts as a counter:
It produces:
I want to modify the traversal to use this count to produce ["foo", "bar"]. So, I tried adding
But the code above does not work as expected, it produces no output.
Interestingly, if I change
Could someone help me understand why
Thanks in advance!
It produces:
I want to modify the traversal to use this count to produce ["foo", "bar"]. So, I tried adding
.as("cnt").select("map").select(select("cnt")) like this:But the code above does not work as expected, it produces no output.
Interestingly, if I change
select("cnt") to constant(3), then it starts producing foo:Could someone help me understand why
select("cnt") is not working here and why using constant(3) works?Thanks in advance!
Solution
This is caused (if you are using TinkerGraph for example) by Java's HashMap implementation and the fact that a Long will not match an Integer type.