我试图将数据从webform插入到neo4j数据库,但是我的记录已被插入但同时我得到了这个错误套接字挂起。 并且匹配查询无法帮助解决此问题
app.post('/insert',function (req,res){
var email = req.body['email'];
var password = req.body['password'];
var query = [
'CREATE (user:test {newUser})'
// 'RETURN user'
]
var params = {
newUser: {
email: email,
password: password,
}
};
db.cypher({
query: query,
params: params
},
function(err,user){
if(err) console.log(err) ;
console.log(user);
res.send("Record has been Inserted ");
});
})
app.get('/json', function(req,res){
db.cypher({
query: 'MATCH (user:test {email: {email}}) RETURN user'
}, function (err, results) {
if (err) console.log(err);
var result = results[2];
if (!result) {
console.log('No user found.');
} else {
var user = result['user'];
console.log(JSON.stringify(user, null, 4));
}
});
})