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 @@ -31,12 +31,18 @@ angular.module('neo4jApp.services')
31
31
clearConnection : -> Bolt .clearConnection ()
32
32
getSchema : ->
33
33
q = $q .defer ()
34
- $q .all ([
35
- Bolt .callProcedure (" db.indexes" ),
36
- Bolt .callProcedure (" db.constraints" ),
37
- ]).then ((data ) ->
38
- q .resolve (Bolt .constructSchemaResult data[0 ], data[1 ])
39
- )
34
+ Bolt .boltTransaction (
35
+ " CALL db.indexes() YIELD description, state, type " +
36
+ " WITH COLLECT({description: description, state: state, type: type}) AS indexes " +
37
+ " RETURN 'indexes' AS name, indexes AS items " +
38
+ " UNION " +
39
+ " CALL db.constraints() YIELD description " +
40
+ " WITH COLLECT({description: description}) AS constraints " +
41
+ " RETURN 'constraints' AS name, constraints AS items"
42
+ ).promise .then ((result ) ->
43
+ return q .resolve (Bolt .constructSchemaResult ([], [])) unless result .records .length
44
+ q .resolve (Bolt .constructSchemaResult result .records [0 ].get (' items' ), result .records [1 ].get (' items' ))
45
+ ).catch ( (e ) -> q .reject Bolt .constructResult e)
40
46
q .promise
41
47
42
48
getMeta : ->
You can’t perform that action at this time.
0 commit comments