I am using es6 on nodejs, and am trying to execute the project() step in a gremlin query.
As part of the projection, I want to extract the properties.
Using
valueMap()
, outV()
and similar traversals are spawned anonymously from a double underscore class - __
- so your code could be re-written as:
const gremlin = require('gremlin');
const __ = gremlin.process.statics;
g.V('test-id')
.bothE()
.limit(10)
.project('id', 'properties', 'out', 'in')
.by(id)
.by(__.valueMap())
.by(__.outV().id())
.by(__.inV().id())