错误:套接字挂起无法读取属性结果[2]

时间:2016-07-29 11:52:32

标签: node.js neo4j

我试图将数据从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));
    }
});
})

0 个答案:

没有答案