How to find nodes with a scalar predicate having values found during traversal

Not sure, it’s curious.