[
https://issues.apache.org/jira/browse/TINKERPOP-1708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16072269#comment-16072269
]
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_r125266019
--- 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.
+<4> `count(global)` is the same as `count()` as the default behavior for
most scoped steps is `global`.
+
+The steps that support scoping are:
+
+* <<count-step,`count()`>>: count the local collection or global stream.
+* <<dedup-step, `dedup()`>>: dedup the local collection of global stream.
+* <<max-step, `max()`>>: get the max value in the local collection or
global stream.
+* <<mean-step, `mean()`>>: get the mean value in the local collection or
global stream.
+* <<min-step, `min()`>>: get the min value in the local collection or
global stream.
+* <<order-step,`order()`>>: order the objects in the local collection or
global stream.
+* <<range-step, `range()`>>: clip the local collection or global stream.
+* <<sample-step, `sample()`>>: sample objects from the local collection or
global stream.
+* <<tail-step, `tail()`>>: get the tail of the objects in the local
collection or global stream.
--- End diff --
`limit()` is missing. I know it's `RangeStep`, but in the user docs we
describe `range()` and `limit()` as different steps.
> 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)