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

Use of fold() in repeat()

    XMLWordPrintableJSON

Details

    Description

      I would expect these two traversals to be equivalent:

      gremlin> g = TinkerFactory.createModern().traversal()
      ==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
      gremlin> g.V(1).repeat(out().fold().unfold()).times(2)
      gremlin> g.V(1).repeat(out()).times(2)
      ==>v[5]
      ==>v[3]
      

      Also note something dkuppitz pointed out:

      gremlin> g.V(1).repeat(out().fold()).times(1)
      ==>[]
      gremlin> g.V(1).out().fold()
      ==>[v[3], v[2], v[4]]
      

      Attachments

        Activity

          People

            okram Marko A. Rodriguez
            spmallette Stephen Mallette
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: