2.0.1 • Published 2 years ago

@rough/rx-gremlin v2.0.1

Weekly downloads
50
License
MIT
Repository
github
Last release
2 years ago

The simplest RxJS wrapper around gremlin lib

Build Status npm version

Rough implementation of rxified wrapper of gremlin lib.

Usage examples

const { tap } = require('rxjs/operators');
const RxGremlin = require('@rough/rx-gremlin');

const gremlin = new RxGremlin('ws://gremlin-server:8182/gremlin');

gremlin.traverse(g => g.V().hasLabel('Person').valueMap(true).next())
  .pipe(
    tap(({ value }) => console.log(value))
  )
  // .subscribe ...

Also, each g instance has handy shortcuts as follows:

g.T = gremlin.process.t;
g.G = gremlin.process.statics;
g.P = gremlin.process.P;
g.TextP = gremlin.process.TextP;
g.C = gremlin.process.cardinality;
g.O = gremlin.process.order;

What can be used right away without additional imports:

// ...
g => g.V()
  .has(g.T.label, g.P.within('Entity', 'Person'))
  .has('description', g.P.not(g.TextP.containing(['word1', 'word2'])))
  .where(g.G.not(g.G.outE('parent')))
  .order().by('updated_at', g.O.desc)
  .valueMap(true)
  .toList()
// ...

Configuration

For connection options see official DriverRemoteConnection class. You may pass such options as the second parameter of the constructor, e.g. in order to switch from default GraphSON to GraphBinary protocol you would do the following:

new RxGremlin('ws://gremlin-server:8182/gremlin', { mimeType: 'application/vnd.graphbinary-v1.0' });
2.0.1

2 years ago

2.0.0

2 years ago

1.8.0

3 years ago

1.7.0

3 years ago

1.6.0

4 years ago

1.5.1

5 years ago

1.5.0

5 years ago

1.4.0

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago