© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Apache TinkerPopAT
Apache TinkerPop•3y ago•
4 replies
tobaseru

repeat and until methods in Javascript Gremlin:

I'm not particularly sure how to use them properly. From my current understanding, repeat() and until() are both instance methods of the GraphTraversal class, but how do I reference any methods within the class body but still refer to the same reference?

const org = await g.V().until((r) => r.hasLabel('')).repeat({...}).path().by('name').next()
const org = await g.V().until((r) => r.hasLabel('')).repeat({...}).path().by('name').next()

What goes in the {...}? (If possible, can I see which imports you used if any in order to reference it completely? Much thanks.)

For context, I'm trying to continue along in-edges until I reach a vertex labelled "b".
Solution
I think this section of the documentation will help with imports: https://tinkerpop.apache.org/docs/current/reference/#gremlin-javascript-imports In particular:
const __ = gremlin.process.statics;
const org = await g.V().until__.hasLabel('b')).
                          repeat(__.in()).
                        path().by('name').next()
const __ = gremlin.process.statics;
const org = await g.V().until__.hasLabel('b')).
                          repeat(__.in()).
                        path().by('name').next()
Jump to solution
Apache TinkerPop banner
Apache TinkerPopJoin
Apache TinkerPop is an open source graph computing framework and the home of the Gremlin graph query language.
1,376Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

AWS Neptune and gremlin-javascript versions
Apache TinkerPopATApache TinkerPop / questions
3y ago
When gremlin-JavaScript release?
Apache TinkerPopATApache TinkerPop / questions
9mo ago
Gremlin-JavaScript Global Websocket
Apache TinkerPopATApache TinkerPop / questions
14mo ago
`next(n)` with Gremlin JavaScript
Apache TinkerPopATApache TinkerPop / questions
2y ago