cypher-stream
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -7,2 +7,6 @@ var oboe = require('oboe'); | ||
function extractData(item) { | ||
return item.data; | ||
} | ||
function CypherStream (url, query, params) { | ||
@@ -26,2 +30,6 @@ Readable.call(this, { objectMode: true }); | ||
columns.forEach(function (column, i) { | ||
if(result[i].length && result[i][0].data) { | ||
data[column] = result[i].map(extractData); | ||
return; | ||
} | ||
data[column] = result[i].data || result[i]; | ||
@@ -28,0 +36,0 @@ }); |
{ | ||
"name": "cypher-stream", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "Streams cypher query results in a clean format", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -71,3 +71,21 @@ var should = require('should'); | ||
it('returns non-node results', function (done) { | ||
it('returns non-object values', function (done) { | ||
cypher('match (n:Test) return n.test as test limit 1') | ||
.on('data', function (result) { | ||
result.test.should.be.true; | ||
}) | ||
.on('end', done) | ||
; | ||
}); | ||
it('returns collections', function (done) { | ||
cypher('match (n:Test) return collect(n) as nodes limit 1') | ||
.on('data', function (result) { | ||
result.nodes[0].test.should.be.true; | ||
}) | ||
.on('end', done) | ||
; | ||
}); | ||
it('returns non-node collections', function (done) { | ||
cypher('match (n:Test) return labels(n) as labels limit 1') | ||
@@ -77,7 +95,6 @@ .on('data', function (result) { | ||
}) | ||
.on('end', function () { | ||
done(); | ||
}); | ||
.on('end', done) | ||
; | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18971
156