Skip to content

Instantly share code, notes, and snippets.

@spmallette
Last active April 13, 2023 15:57
Show Gist options
  • Save spmallette/39396f465f8d9d924b3c5f5e24b3f96a to your computer and use it in GitHub Desktop.
Save spmallette/39396f465f8d9d924b3c5f5e24b3f96a to your computer and use it in GitHub Desktop.
gremlin> g.inject([1,2],[1,2,3],[1,3],[1,2,3]).dedup().by(union(limit(local,1), tail(local)).fold())
==>[1,2]
==>[1,2,3]
gremlin> g.inject([1,2],[1,2,3],[1,3],[1,2,3]).dedup().by(project('p1','p2').by(limit(local,1)).by(tail(local)))
==>[1,2]
==>[1,2,3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment