Search code examples
orientdbgremlintinkerpop3

Is it possible to use Tinkerpop/Gremlin in Nodejs to manipulate data in OrientDB?


I want to connect my local Nodejs (NO JVM) application using Gremlin/Tinkerpop to a remote OrientDB 3.x instance. Is that possible at all? How?

I tried it using "gremlin" npm library without success.

const gremlin = require('gremlin');

const DriverRemoteConnection = gremlin.driver.DriverRemoteConnection;
const traversal = gremlin.process.traversal;
const PlainTextSaslAuthenticator = gremlin.driver.auth.PlainTextSaslAuthenticator;

const authenticator = new PlainTextSaslAuthenticator('root', 'admin');
const g = await traversal().withRemote(new DriverRemoteConnection('wss://localhost:8182/demodb', {authenticator: authenticator}));

And would expect it to connect, but instead I get this error:

Unhandled exception at: Error: Client network socket disconnected before secure TLS connection was established
    at TLSSocket.onConnectEnd (_tls_wrap.js:1177:19)
    at Object.onceWrapper (events.js:285:13)
    at TLSSocket.emit (events.js:202:15)
    at endReadableNT (_stream_readable.js:1129:12)
    at processTicksAndRejections (internal/process/next_tick.js:76:17)

Solution

  • Ok I managed to do it with url ws://localhost:8182/gremlin, and the database accessed by gremlin I configure in the gremlin-server.yaml file in the OrientDB folder.