File tree 3 files changed +23
-27
lines changed
3 files changed +23
-27
lines changed Original file line number Diff line number Diff line change @@ -3,26 +3,21 @@ const RedisGraph = require('../src/redisGraph');
3
3
4
4
let graph = new RedisGraph ( 'social' ) ;
5
5
6
- graph . query ( "CREATE (:person{name:'roi',age:32})" ) . then ( ( res ) => {
7
- console . log ( '@1111' )
8
- console . log ( res ) ;
6
+ graph
7
+ . query ( "CREATE (:person{name:'roi',age:32})" )
8
+ . then ( ( ) => {
9
+ return graph . query ( "CREATE (:person{name:'amit',age:30})" ) ;
10
+ } )
11
+ . then ( ( ) => {
12
+ return graph . query ( "MATCH (a:person), (b:person) WHERE (a.name = 'roi' AND b.name='amit') CREATE (a)-[knows]->(a)" )
13
+ } )
14
+ . then ( ( ) => {
15
+ return graph . query ( "MATCH (a:person)-[knows]->(:person) RETURN a" )
16
+ } )
17
+ . then ( ( res ) => {
18
+ while ( res . hasNext ( ) ) {
19
+ let record = res . next ( ) ;
20
+ console . log ( record . getString ( 'a.name' ) ) ;
21
+ }
22
+ console . log ( res . getStatistics ( ) . queryExecutionTime ( ) ) ;
9
23
} ) ;
10
- graph . query ( "CREATE (:person{name:'amit',age:30})" ) . then ( ( res ) => {
11
- console . log ( res ) ;
12
- console . log ( "AAA " + res . getStatistics ( ) . nodesCreated ( ) ) ;
13
- } ) ;
14
-
15
- graph . query ( "MATCH (a:person), (b:person) WHERE (a.name = 'roi' AND b.name='amit') CREATE (a)-[knows]->(a)" ) . then ( ( res ) => {
16
- console . log ( '@33333' )
17
- console . log ( res ) ;
18
- } ) ;
19
- //
20
- graph . query ( "MATCH (a:person)-[knows]->(:person) RETURN a" ) . then ( ( res ) => {
21
- console . log ( res ) ;
22
- console . log ( "AAA " + res . getStatistics ( ) . nodesCreated ( ) ) ;
23
- } ) ;
24
- //
25
- //while(resultSet.hasNext()){
26
- // Record record = resultSet.next();
27
- // System.out.println(record.getString("a.name"));
28
- //}
Original file line number Diff line number Diff line change @@ -30,9 +30,5 @@ module.exports = class Record {
30
30
31
31
size ( ) {
32
32
return this . _header . length ;
33
- }
34
-
35
- toString ( ) {
36
- return this . _values . toString ( ) ;
37
- }
33
+ }
38
34
}
Original file line number Diff line number Diff line change @@ -68,5 +68,10 @@ module.exports ={
68
68
propertiesSet ( ) {
69
69
return this . getIntValue ( Label . PROPERTIES_SET ) ;
70
70
}
71
+
72
+ queryExecutionTime ( ) {
73
+ return this . getIntValue ( Label . QUERY_INTERNAL_EXECUTION_TIME ) ;
74
+ }
75
+
71
76
}
72
77
}
You can’t perform that action at this time.
0 commit comments