Stephen Mallette created TINKERPOP-2709:
-------------------------------------------
Summary: Avoid need to fold() to addAll for sack()
Key: TINKERPOP-2709
URL: https://issues.apache.org/jira/browse/TINKERPOP-2709
Project: TinkerPop
Issue Type: Improvement
Components: process
Affects Versions: 3.5.2
Reporter: Stephen Mallette
If you want to maintain a collection of things in a sack you can use {{addAll}}
to combine lists/maps:
{code:java}
gremlin>
g.V(3).valueMap('city').sack(assign).by(fold()).V(4).sack(addAll).by(fold()).sack()
==>[[city:[Austin]],v[4]]
{code}
It would be nice to be able to do that without having to manually
{{by(fold())}} and simply assume that if an object is not a collection it is
meant to go into one by virtual of using {{addAll}}. Or perhaps {{addAll}}
should be reserved for combining collections and we should have a {{add}}
operator that will add to a collection. There are multiple ways it could
probably be done.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)