graph
graph copied to clipboard
Add an example of using sack() with predicates
Add an example that shows how to compare a property with the contents of a sack. Something like this needs to be added.
gremlin> g.withSack(6).V().hasLabel('airport').as('a').where(gt('a')).by('runways').by(sack())
==>v[8]
==>v[18]
Keep in mind that any .as('something')
will enable (partial) path tracking. You want to prevent path tracking whenever possible, thus the better solution would be:
g.withSack(6).V().hasLabel('airport').
filter(project('a','b').
by('runways').
by(sack()).
where('a', gt('b')))
Thanks Daniel for the reminder. I'll do examples of each with some discussion of why one is preferable over the other. I probably also need to go back and reinforce path tracking overhead some more in a few places.
Closing as this is fixed and work has now started on the second edition. There will likely be one final release of the v283 first edition line before the V2 branch becomes the second edition. That release will include these fixes.