I'm a self taught novice programmer working on a simple web application that uses Angular.js, Node.js, and the graph database neo4j. Right now I'm trying to get a a very basic query to execute and return data to the client. Upon execution I get an error which closes the server.
The following function is executed upon receiving a get request:
exports.test = function (req, res) {
var neo4j = require('neo4j');
var db = new neo4j.GraphDatabase('http://localhost:7474');
var query = [
'MATCH n',
'RETURN n.name, n, labels(n)'
];
db.query(query, function (err, results) {
if (err) {throw err};
var data = results.map(function(result) {
return result;
});
res.send(data)
}
)};
I get the following error in the console log: java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.String
(I can provide the entire log if it would prove useful)
I would be extremely grateful for any insights.