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 ad69f77871 Added merge() example with Map to docs CTR
new 8fc71d880d Merge branch '3.7-dev'
ad69f77871 is described below
commit ad69f778712dd7de63c17e86f49ed371c1afa432
Author: Stephen Mallette <[email protected]>
AuthorDate: Wed Jun 12 07:11:47 2024 -0400
Added merge() example with Map to docs CTR
---
docs/src/reference/the-traversal.asciidoc | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/docs/src/reference/the-traversal.asciidoc
b/docs/src/reference/the-traversal.asciidoc
index e3d04ec1fa..42fa143fcf 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -2762,15 +2762,17 @@
link:++https://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gre
[[merge-step]]
=== Merge Step
-The `merge()`-step (*map*) merges the elements of the incoming list traverser
and the provided list argument into one
-list. This is also known as the union operation. This step only expects list
data (array or Iterable) and will throw
-an `IllegalArgumentException` if any other type is encountered (including
`null`). This differs from the `combine()`-step
-in that it doesn't allow duplicates.
+The `merge()`-step (*map*) combines collections like lists and maps. It
expects an incoming traverser to contain a
+collection objection and will combine that object with its specified argument
which must be of a matching type. This is
+also known as the union operation. If the incoming traverser or its associated
argument do not meet the expected type,
+the step will throw an `IllegalArgumentException` if any other type is
encountered (including `null`). This step differs
+from the `combine()`-step in that it doesn't allow duplicates.
[gremlin-groovy,modern]
----
g.V().values("name").fold().merge(["james","jen","marko","vadas"])
g.V().values("name").fold().merge(__.constant("james").fold())
+g.V().hasLabel('software').elementMap().merge([year:2009])
----
*Additional References*