You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/07/03 11:18:00 UTC
[jira] [Commented] (TINKERPOP-1708) Add a "Note on Scopes" document
[ https://issues.apache.org/jira/browse/TINKERPOP-1708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16072270#comment-16072270 ]
ASF GitHub Bot commented on TINKERPOP-1708:
-------------------------------------------
Github user dkuppitz commented on a diff in the pull request:
https://github.com/apache/tinkerpop/pull/647#discussion_r125265003
--- Diff: docs/src/reference/the-traversal.asciidoc ---
@@ -2574,6 +2574,58 @@ possible at the current, local vertex. What it can't compute without referencing
into a barrier collection. When there are no more traversers at the local vertex, the barriered traversers are the
messages that are propagated to remote vertices for further processing.
+[[a-note-on-scopes]]
+A Note on Scopes
+----------------
+
+The `Scope` enum has two constants: `Scope.local` and `Scope.global`. Scope determines whether the particular step
+being scoped is with respects to the current object (`local`) at that step or to the entire stream of objects up to that
+step (`global`).
+
+[gremlin-groovy,modern]
+----
+g.V().has('name','marko').out('knows').count() <1>
+g.V().has('name','marko').out('knows').fold().count() <2>
+g.V().has('name','marko').out('knows').fold().count(local) <3>
+g.V().has('name','marko').out('knows').fold().count(global) <4>
+----
+
+<1> Marko knows 2 people.
+<2> A list of Marko's friends is created and thus, one object is counted (the single list).
+<3> A list of Marko's fiends is created and a `local`-count yields the number of objects in that list.
--- End diff --
fiends => friends
> Add a "Note on Scopes" document
> -------------------------------
>
> Key: TINKERPOP-1708
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1708
> Project: TinkerPop
> Issue Type: Improvement
> Components: documentation
> Affects Versions: 3.2.5
> Reporter: Marko A. Rodriguez
> Assignee: Marko A. Rodriguez
>
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)