You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by dk...@apache.org on 2017/01/10 10:27:48 UTC
tinkerpop git commit: Added `skip()` in the reference docs.
Repository: tinkerpop
Updated Branches:
refs/heads/TINKERPOP-1549 3d0aa6e37 -> 71de237d3
Added `skip()` in the reference docs.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/71de237d
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/71de237d
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/71de237d
Branch: refs/heads/TINKERPOP-1549
Commit: 71de237d32b687d2ee70ccecd2e7bf8d86a64b24
Parents: 3d0aa6e
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Tue Jan 10 11:26:53 2017 +0100
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Tue Jan 10 11:26:53 2017 +0100
----------------------------------------------------------------------
docs/src/reference/the-traversal.asciidoc | 29 ++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71de237d/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc
index b468e48..0dafd22 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -1916,6 +1916,35 @@ g.V(1).both().both().simplePath()
g.V(1).both().both().simplePath().path()
----
+[[skip-step]]
+Skip Step
+~~~~~~~~~
+
+The `skip()`-step is analogous to <<range-step,`range()`-step>> save that the higher end range is set to -1.
+
+[gremlin-groovy,modern]
+----
+g.V().skip(2)
+g.V().range(2, -1)
+g.V().skip(2).toString()
+----
+
+The `skip()`-step can also be applied with `Scope.local`, in which case it operates on the incoming collection.
+
+[gremlin-groovy,modern]
+----
+g.V().hasLabel('person').filter(outE('created')).as('p'). <1>
+ map(out('created').values('name').fold()).
+ project('person','primary','other').
+ by(select('p').by('name')).
+ by(limit(local, 1)). <2>
+ by(skip(local, 1)) <3>
+----
+
+<1> For each person who created something...
+<2> ...select the first project (random order) as `primary` and...
+<3> ...select all other projects as `other`.
+
[[store-step]]
Store Step
~~~~~~~~~~