Skip to content

Commit ec43e43

Browse files
committed
Refactor ResultSummary statistics -> updateStatistics
1 parent c245273 commit ec43e43

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

examples/node.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ streamResult.subscribe({
2929
var summary = streamResult.summarize();
3030
//Print number of nodes created
3131
console.log('');
32-
console.log(summary.statistics.nodesCreated());
32+
console.log(summary.updateStatistics.nodesCreated());
3333
streamSession.close();
3434
}, onError: function(error) {
3535
console.log(error);
@@ -48,7 +48,7 @@ promiseResult.then(function(records) {
4848
var summary = promiseResult.summarize();
4949
//Print number of nodes created
5050
console.log('');
51-
console.log(summary.statistics.nodesCreated());
51+
console.log(summary.updateStatistics.nodesCreated());
5252
})
5353
.catch(function(error) {
5454
console.log(error);

lib/result.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,13 @@ class ResultSummary {
118118
* @constructor
119119
* @param {string} statement - The statement this summary is for
120120
* @param {Object} parameters - Parameters for the statement
121-
* @param {string} statementType - How did the statement effect the database
122-
* @param {Object} statistics - Result statistics
121+
* @param {Object} metadata - Statement metadata
123122
*/
124123
constructor(statement, parameters, metadata) {
125124
let {type: statementType, stats: statistics, plan, profile} = metadata;
126125
this.statement = {text: statement, parameters};
127126
this.statementType = statementType;
128-
this.statistics = new StatementStatistics(statistics || {});
127+
this.updateStatistics = new StatementStatistics(statistics || {});
129128
this.plan = plan || profile ? new Plan(plan || profile) : false;
130129
this.profile = profile ? new ProfiledPlan(profile) : false;
131130
}

test/session.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ describe('session', function() {
8484
var sum = result.summarize();
8585
expect(sum.statement.text).toBe( statement );
8686
expect(sum.statement.parameters).toBe( params );
87-
expect(sum.statistics.containsUpdates()).toBe(true);
88-
expect(sum.statistics.nodesCreated()).toBe(1);
87+
expect(sum.updateStatistics.containsUpdates()).toBe(true);
88+
expect(sum.updateStatistics.nodesCreated()).toBe(1);
8989
expect(sum.statementType).toBe(StatementType.READ_WRITE);
9090
driver.close();
9191
done();

0 commit comments

Comments
 (0)