1 Answer
- Newest
- Most votes
- Most comments
0
It looks like there was an answer on StackOverflow. Copying that example here to connect the dots.
const gremlin = require('gremlin');
const traversal = gremlin.process.AnonymousTraversalSource.traversal;
const DriverRemoteConnection = gremlin.driver.DriverRemoteConnection;
const direction = gremlin.process.direction
const t = gremlin.process.t
const { onCreate, onMatch } = gremlin.process.merge;
const g = traversal().withRemote(new DriverRemoteConnection('wss://<CLUSTER ENDPOINT>:8182/gremlin'));
g.
mergeE(new Map([[t.label,"Test"],
[direction.out,'1'],[direction.in,'2']])).
option(onCreate,new Map([["created",Date.now()]])).
option(onMatch,new Map([["updated",Date.now()]])).elementMap().toList().then(data => console.log(data))
answered 9 months ago
Relevant content
- asked 2 years ago
- asked a year ago
- asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago