This is an automated email from the ASF dual-hosted git repository.
spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
The following commit(s) were added to refs/heads/master by this push:
new 2519d37327 Clarify that sum(local) also accepts a scalar Number
2519d37327 is described below
commit 2519d373273d1f34695ccda977f74f9c87b1fd3a
Author: Stephen Mallette <[email protected]>
AuthorDate: Wed Aug 5 17:28:36 2026 +0000
Clarify that sum(local) also accepts a scalar Number
The sum()-step reference previously stated that sum(local) works for
Collection-type objects, which implied it only accepts Collections. In
fact sum(local) also accepts a scalar Number and returns that number
itself as an identity operation. Update the wording so readers know both
cases are supported.
Assisted-by: Kiro:claude-opus-4.8
---
docs/src/reference/the-traversal.asciidoc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/docs/src/reference/the-traversal.asciidoc
b/docs/src/reference/the-traversal.asciidoc
index e4b35f54ee..372fbc6041 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -5493,7 +5493,8 @@ g.V().repeat(both()).times(3).values('age').sum()
----
When called as `sum(local)` it determines the sum of the current, local object
(not the objects in the traversal
-stream). This works for `Collection`-type objects.
+stream). This works for `Collection`-type objects (summing their numeric
elements) and for scalar `Number` values
+(returning the number itself).
[gremlin-groovy,modern]
----