Skip to content

Commit deaedfa

Browse files
committed
fix #1 add support for passing different arguments to node_redis client
1 parent 91bef0d commit deaedfa

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "BSD 3",
77
"repository": {
88
"type": "git",
9-
"url": "git://github.com/redislabs/redisgraphjs.git"
9+
"url": "git://github.com/redislabs/redisgraph.js.git"
1010
},
1111
"dependencies": {
1212
"redis": "^2.8.0"

src/redisGraph.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ module.exports = class RedisGraph {
99

1010
/**
1111
* Creates a client to a specific graph running on the specific host/post
12-
*
12+
* See: node_redis for more options on createClient
13+
*
1314
* @param graphId the graph id
1415
* @param host Redis host
1516
* @param port Redis port
1617
*/
17-
constructor(graphId, host, port) {
18+
constructor(graphId, host, port, options) {
1819
this._graphId = graphId;
19-
let client = redis.createClient(port, host);
20+
let client = redis.createClient.apply(redis, [].slice.call(arguments,1));
2021
this._sendCommand = util.promisify(client.send_command).bind(client);
2122
}
2223

test/redisGraphAPITest.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe('RedisGraphAPI Test', () =>{
4040
let createResult2 = api.query("CREATE (:person{name:'amit',age:30})");
4141

4242
// Connect source and destination nodes.
43-
return api.query("MATCH (a:person), (b:person) WHERE (a.name = 'roi' AND b.name='amit') CREATE (a)-[knows]->(a)")
43+
return api.query("MATCH (a:person), (b:person) WHERE (a.name = 'roi' AND b.name='amit') CREATE (a)-[:knows]->(a)")
4444
.then( (matchResult) => {
4545
assert.ok(!matchResult.hasNext());
4646
assert.ifError(matchResult.getStatistics().getStringValue(Label.NODES_CREATED));
@@ -60,7 +60,7 @@ describe('RedisGraphAPI Test', () =>{
6060
})
6161
.then( (create2Result) => {
6262
// Connect source and destination nodes.
63-
return api.query("MATCH (a:qhuman), (b:qhuman) WHERE (a.name = 'roi' AND b.name='amit') CREATE (a)-[knows]->(b)");
63+
return api.query("MATCH (a:qhuman), (b:qhuman) WHERE (a.name = 'roi' AND b.name='amit') CREATE (a)-[:knows]->(b)");
6464
})
6565
.then( (connectResult) => {
6666
// Query

0 commit comments

Comments
 (0)