Skip to content

Commit

Permalink
Start all connections with new with()
Browse files Browse the repository at this point in the history
  • Loading branch information
ryn5 committed Dec 19, 2023
1 parent 7cefd44 commit e703539
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions gremlin-dotnet/Examples/Connections/Connections.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static void withConf()
{
using var remoteConnection = new DriverRemoteConnection(new GremlinClient(
new GremlinServer(hostname: "localhost", port: 8182, enableSsl: false, username: "", password: "")), "g");
var g = Traversal().WithRemote(remoteConnection);
var g = Traversal().With(remoteConnection);

var v = g.AddV().Iterate();
var count = g.V().Count().Next();
Expand All @@ -65,7 +65,7 @@ static void withSerializer()
var server = new GremlinServer("localhost", 8182);
var client = new GremlinClient(server, new GraphSON3MessageSerializer());
using var remoteConnection = new DriverRemoteConnection(client, "g");
var g = Traversal().WithRemote(remoteConnection);
var g = Traversal().With(remoteConnection);

var v = g.AddV().Iterate();
var count = g.V().Count().Next();
Expand Down
2 changes: 1 addition & 1 deletion gremlin-go/examples/connections.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func withConfigs() {
}

defer driverRemoteConnection.Close()
g := gremlingo.Traversal_().WithRemote(driverRemoteConnection)
g := gremlingo.Traversal_().With(driverRemoteConnection)

g.AddV().Iterate()
count, _ := g.V().Count().Next()
Expand Down
2 changes: 1 addition & 1 deletion gremlin-go/examples/modern_traversals.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func main() {
return
}
defer driverRemoteConnection.Close()
g := gremlingo.Traversal_().WithRemote(driverRemoteConnection)
g := gremlingo.Traversal_().With(driverRemoteConnection)

/*
This example requires the Modern toy graph to be preloaded upon launching the Gremlin server.
Expand Down
2 changes: 1 addition & 1 deletion gremlin-javascript/examples/basic-gremlin.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const DriverRemoteConnection = gremlin.driver.DriverRemoteConnection;

async function main() {
const dc = new DriverRemoteConnection('ws://localhost:8182/gremlin');
const g = traversal().with(dc);
const g = traversal().with_(dc);

// Basic Gremlin: adding and retrieving data
const v1 = await g.addV('person').property('name','marko').next();
Expand Down
4 changes: 2 additions & 2 deletions gremlin-javascript/examples/connections.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async function main() {
async function withRemote() {
// Connecting to the server
const dc = new DriverRemoteConnection('ws://localhost:8182/gremlin');
const g = traversal().with(dc);
const g = traversal().with_(dc);

// Drop existing vertices
await g.V().drop().iterate();
Expand All @@ -53,7 +53,7 @@ async function withConfigs() {
rejectUnauthorized: false,
traversalSource: 'g',
});
const g = traversal().withRemote(dc);
const g = traversal().with_(dc);

const v = await g.addV().iterate();
const count = await g.V().count().next();
Expand Down
2 changes: 1 addition & 1 deletion gremlin-javascript/examples/modern-traversals.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async function main() {
conf/gremlin-server-modern.yaml.
*/
const dc = new DriverRemoteConnection('ws://localhost:8182/gremlin');
const g = traversal().with(dc);
const g = traversal().withRemote(dc);

const e1 = await g.V(1).bothE().toList(); // (1)
const e2 = await g.V(1).bothE().where(__.otherV().hasId(2)).toList(); // (2)
Expand Down
6 changes: 3 additions & 3 deletions gremlin-python/src/main/python/examples/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def with_remote():
# connecting with plain text authentication
def with_auth():
rc = DriverRemoteConnection('ws://localhost:8182/gremlin', 'g', username='stephen', password='password')
g = traversal().with_remote(rc)
g = traversal().with_(rc)

v = g.add_v().iterate()
count = g.V().count().next()
Expand All @@ -70,7 +70,7 @@ def with_auth():
# connecting with Kerberos SASL authentication
def with_kerberos():
rc = DriverRemoteConnection('ws://localhost:8182/gremlin', 'g', kerberized_service='[email protected]')
g = traversal().with_remote(rc)
g = traversal().with_(rc)

v = g.add_v().iterate()
count = g.V().count().next()
Expand All @@ -88,7 +88,7 @@ def with_configs():
graphson_writer=None, headers=None, session=None,
enable_user_agent_on_connect=True
)
g = traversal().with_remote(rc)
g = traversal().with_(rc)

v = g.add_v().iterate()
count = g.V().count().next()
Expand Down

0 comments on commit e703539

Please sign in to comment.