You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ok...@apache.org on 2015/05/16 03:03:28 UTC

[3/3] incubator-tinkerpop git commit: Add range(local) doc

Add range(local) doc


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/15899c76
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/15899c76
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/15899c76

Branch: refs/heads/master
Commit: 15899c7613307bbe123e8698cb5389f48e5ea192
Parents: f960151
Author: mhfrantz <mf...@redsealnetworks.com>
Authored: Fri May 15 17:24:54 2015 -0700
Committer: mhfrantz <mf...@redsealnetworks.com>
Committed: Fri May 15 17:28:36 2015 -0700

----------------------------------------------------------------------
 docs/src/the-traversal.asciidoc | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/15899c76/docs/src/the-traversal.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/the-traversal.asciidoc b/docs/src/the-traversal.asciidoc
index 36415d6..b071150 100644
--- a/docs/src/the-traversal.asciidoc
+++ b/docs/src/the-traversal.asciidoc
@@ -982,6 +982,20 @@ g.V().range(1,3)
 g.V().repeat(both()).times(1000000).emit().range(6,10)
 ----
 
+The `range()`-step can also be applied with `Scope.local`, in which case it operates on the incoming collection.  For example, you can produce a `Map<String, String>` for each traversed path, but containing only the second property value (the "b" step).
+
+[gremlin-groovy,modern]
+----
+g.V().as('a').out().as('b').in().as('c').select().by('name').range(local,1,2)
+----
+
+The next example uses the <<the-crew-toy-graph,The Crew>> toy data set.  It produces a `List<String>` containing the second and third location for each vertex.
+
+[gremlin-groovy,theCrew]
+----
+g.V().valueMap().select(local,'location').range(local, 1, 3)
+----
+
 [[repeat-step]]
 Repeat Step
 ~~~~~~~~~~~