Class: AnonymousTraversalSource

AnonymousTraversalSource(traversalSourceClassopt)

Provides a unified way to construct a TraversalSource from the perspective of the traversal. In this syntax the user is creating the source and binding it to a reference which is either an existing Graph instance or a RemoteConnection.

Constructor

new AnonymousTraversalSource(traversalSourceClassopt)

Creates a new instance of {@code AnonymousTraversalSource}.
Parameters:
Name Type Attributes Description
traversalSourceClass function <optional>
Optional {@code GraphTraversalSource} constructor.
Source:

Methods

(static) traversal(traversalSourceClassopt) → {AnonymousTraversalSource}

Constructs an {@code AnonymousTraversalSource} which will then be configured to spawn a GraphTraversalSource.
Parameters:
Name Type Attributes Description
traversalSourceClass function <optional>
Optional {@code GraphTraversalSource} constructor.
Source:
Returns:
.
Type
AnonymousTraversalSource

withGraph(graph) → {GraphTraversalSource}

Creates the specified GraphTraversalSource binding an embedded Graph as its reference such that traversals spawned from it will execute over that reference. As there are no "embedded Graph" instances in gremlin-javascript as there on the JVM, the GraphTraversalSource can only ever be constructed as "empty" with a Graph instance (which is only a reference to a graph and is not capable of holding data). As a result, the GraphTraversalSource will do nothing unless a "remote" is then assigned to it later.
Parameters:
Name Type Description
graph Graph
Deprecated:
  • As of release 3.4.9, prefer withRemote until some form of "embedded graph" becomes available at which point there will be support for {@code withEmbedded} which is part of the canonical Java API.
Source:
Returns:
Type
GraphTraversalSource

withRemote(remoteConnection) → {GraphTraversalSource}

Creates a GraphTraversalSource binding a RemoteConnection to a remote Graph instances as its reference so that traversals spawned from it will execute over that reference.
Parameters:
Name Type Description
remoteConnection RemoteConnection
Source:
Returns:
Type
GraphTraversalSource