File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -198,15 +198,15 @@ angular.module('neo4jApp.services')
198
198
else
199
199
indexString = " Indexes"
200
200
for index in indexes
201
- indexString += " \n #{ index .get ( ' description' ) .replace (' INDEX' ,' ' )} #{ index .get ( ' state' ) .toUpperCase ()} "
202
- if index .get ( " type" ) == " node_unique_property"
201
+ indexString += " \n #{ index .description .replace (' INDEX' ,' ' )} #{ index .state .toUpperCase ()} "
202
+ if index .type == " node_unique_property"
203
203
indexString += " (for uniqueness constraint)"
204
204
if (constraints .length == 0 )
205
205
constraintsString = " No constraints"
206
206
else
207
207
constraintsString = " Constraints"
208
208
for constraint in constraints
209
- constraintsString += " \n #{ constraint .get ( ' description' ) .replace (' CONSTRAINT' ,' ' )} "
209
+ constraintsString += " \n #{ constraint .description .replace (' CONSTRAINT' ,' ' )} "
210
210
return " #{ indexString} \n\n #{ constraintsString} \n "
211
211
212
212
boltResultToRESTResult = (result ) ->
Original file line number Diff line number Diff line change @@ -30,12 +30,18 @@ angular.module('neo4jApp.services')
30
30
clearConnection : -> Bolt .clearConnection ()
31
31
getSchema : ->
32
32
q = $q .defer ()
33
- $q .all ([
34
- Bolt .callProcedure (" db.indexes" ),
35
- Bolt .callProcedure (" db.constraints" ),
36
- ]).then ((data ) ->
37
- q .resolve (Bolt .constructSchemaResult data[0 ], data[1 ])
38
- )
33
+ Bolt .boltTransaction (
34
+ " CALL db.indexes() YIELD description, state, type " +
35
+ " WITH COLLECT({description: description, state: state, type: type}) AS indexes " +
36
+ " RETURN 'indexes' AS name, indexes AS items " +
37
+ " UNION " +
38
+ " CALL db.constraints() YIELD description " +
39
+ " WITH COLLECT({description: description}) AS constraints " +
40
+ " RETURN 'constraints' AS name, constraints AS items"
41
+ ).promise .then ((result ) ->
42
+ return q .resolve (Bolt .constructSchemaResult ([], [])) unless result .records .length
43
+ q .resolve (Bolt .constructSchemaResult result .records [0 ].get (' items' ), result .records [1 ].get (' items' ))
44
+ ).catch ( (e ) -> q .reject Bolt .constructResult e)
39
45
q .promise
40
46
41
47
getMeta : ->
You can’t perform that action at this time.
0 commit comments