@@ -6,48 +6,48 @@ import ResultSet from "./ResultSet";
66 * RedisGraph client
77 */
88class RedisGraph {
9- /**
10- * Creates a client to a specific graph running on the specific host/post
11- * See: node_redis for more options on createClient
12- *
13- * @param graphId the graph id
14- * @param host Redis host or node_redis client
15- * @param port Redis port
16- * @param options node_redis options
17- */
18- constructor ( graphId , host , port , options ) {
19- this . _graphId = graphId ;
20- let client =
21- host instanceof redis . RedisClient
22- ? host
23- : redis . createClient . apply ( redis , [ ] . slice . call ( arguments , 1 ) ) ;
24- this . _sendCommand = util . promisify ( client . send_command ) . bind ( client ) ;
25- }
9+ /**
10+ * Creates a client to a specific graph running on the specific host/post
11+ * See: node_redis for more options on createClient
12+ *
13+ * @param graphId the graph id
14+ * @param host Redis host or node_redis client
15+ * @param port Redis port
16+ * @param options node_redis options
17+ */
18+ constructor ( graphId , host , port , options ) {
19+ this . _graphId = graphId ;
20+ let client =
21+ host instanceof redis . RedisClient
22+ ? host
23+ : redis . createClient . apply ( redis , [ ] . slice . call ( arguments , 1 ) ) ;
24+ this . _sendCommand = util . promisify ( client . send_command ) . bind ( client ) ;
25+ }
2626
27- /**
28- * Execute a Cypher query
29- *
30- * @param query Cypher query
31- * @return a result set
32- */
33- query ( query ) {
34- return this . _sendCommand ( "graph.QUERY" , [ this . _graphId , query ] ) . then (
35- res => {
36- return new ResultSet ( res ) ;
37- }
38- ) ;
39- }
27+ /**
28+ * Execute a Cypher query
29+ *
30+ * @param query Cypher query
31+ * @return a result set
32+ */
33+ query ( query ) {
34+ return this . _sendCommand ( "graph.QUERY" , [ this . _graphId , query ] ) . then (
35+ res => {
36+ return new ResultSet ( res ) ;
37+ }
38+ ) ;
39+ }
4040
41- /**
42- * Deletes the entire graph
43- *
44- * @return delete running time statistics
45- */
46- deleteGraph ( ) {
47- return this . _sendCommand ( "graph.DELETE" , [ this . _graphId ] ) . then ( res => {
48- return new ResultSet ( res ) ;
49- } ) ;
50- }
41+ /**
42+ * Deletes the entire graph
43+ *
44+ * @return delete running time statistics
45+ */
46+ deleteGraph ( ) {
47+ return this . _sendCommand ( "graph.DELETE" , [ this . _graphId ] ) . then ( res => {
48+ return new ResultSet ( res ) ;
49+ } ) ;
50+ }
5151}
5252
5353export default RedisGraph ;
0 commit comments