Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-2709

Avoid need to fold() to addAll for sack()

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.5.2
    • None
    • process
    • None

    Description

      If you want to maintain a collection of things in a sack you can use addAll to combine lists/maps:
       

      gremlin> g.V(3).valueMap('city').sack(assign).by(fold()).V(4).sack(addAll).by(fold()).sack()
      ==>[[city:[Austin]],v[4]]   
      

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            spmallette Stephen Mallette
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: