Basic vertex querying does not work in Amazon Neptune but it works with local Gremlin Server

      const fankode : any = await this.gremlinService.readClientSource
        .V( profileId )
        .hasLabel( 'FAN' )
        .next();

When I try to fetch vertex with properties like this , or with elementMap() and valueMap(true), It does not work, it just fetches empty object. I can only query properties of a vertex like this in Amazon neptune
      this.gremlinService.readClientSource
        .V( profileId )
        .hasLabel( 'FAN' )
        .properties()
        .toList(),


but then I would need two queries for basic fetching which I don't want due to performance reasons. Can anyone give me hand here? Thanks
Solution
The gremlin-javascript driver deserializes the elementMap() step into the Map class.
await this.gremlinService.readClientSource.V().elementMap().toList()
will return an Array of Maps.
JSON.stringify()
, which NestJS is likely calling for you, doesn't support Maps so you need to convert them into objects using something like
Object.fromEntries()
.
Was this page helpful?