Skip to content

Unable to create Graph instance with specified port #43

Closed
@abawany

Description

@abawany

I am running my RedisGraph on a port other than 6379. I confirmed via redis-cli that the instance is operating as expected. When I try to use redisgraph.js as follows to create a client with a specified port, it failed as follows:

> const RedisGraph = require('redisgraph.js').Graph;
> new RedisGraph("g1", "localhost", "7070");
Thrown:
TypeError: Cannot create property 'path' on string '7070'
    at createClient (/private/tmp/node_modules/redisgraph.js/node_modules/redis/lib/createClient.js:63:26)
    at Object.exports.createClient (/private/tmp/node_modules/redisgraph.js/node_modules/redis/index.js:1089:41)
    at new Graph (/private/tmp/node_modules/redisgraph.js/src/graph.js:32:26)

Passing an instantiated RedisClient instance with the correct port also fails as follows:

> const rds = require('redis');
> const RedisGraph = require('redisgraph.js').Graph;
> let rc = rds.createClient({host:'localhost', port:7070});
> rc instanceof rds.RedisClient
true
> new RedisGraph("g1", rc);
Thrown:
TypeError: this.stream.setTimeout is not a function
    at RedisClient.create_stream (/private/tmp/node_modules/redisgraph.js/node_modules/redis/index.js:256:21)
    at new RedisClient (/private/tmp/node_modules/redisgraph.js/node_modules/redis/index.js:159:10)
    at Object.exports.createClient (/private/tmp/node_modules/redisgraph.js/node_modules/redis/index.js:1089:12)
    at new Graph (/private/tmp/node_modules/redisgraph.js/src/graph.js:32:26)

Edit: the following appeared to work fine:

> const RedisGraph = require('redisgraph.js').Graph;
> new RedisGraph("g2", {host:"localhost", port:7070});
Graph {
  _graphId: 'g2',
  _labels: [],
  _relationshipTypes: [],
  _properties: [],
  _labelsPromise: undefined,
  _propertyPromise: undefined,
  _relationshipPromise: undefined,
  _sendCommand: [Function: bound ]
}

Did I misread the documentation at https://redisgraph.github.io/redisgraph.js/Graph.html, which appears to specify each parameter as a function argument?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions