是否可以在Nodejs中使用Tinkerpop/Gremlin来操作OrientDB中的数据?

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

我想使用 Gremlin/Tinkerpop 将本地 NodejsNO JVM)应用程序连接到远程 OrientDB 3.x 实例。这可能吗?怎么样?

我尝试使用 "gremlin" npm 库但没有成功。

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}));

并希望它能够连接,但我却收到此错误:

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)

好的,我设法用 url ws://localhost:8182/gremlin 做到了,我在 OrientDB 文件夹的 gremlin-server.yaml 文件中配置了 gremlin 访问的数据库。