cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! Site migration is underway. Expect disruption to service on Thursday, Feb. 9!

Cypher Query for login page

utkarshgoyal55
Node Clone

I have my deatils of the login and password in the following two variables:

let username = req.body.username;
let password = req.body.password

Now I have written the cypher query to fetch the details from the database which matches with the entered username and password, but my query does not fetch any result, but the node of that username and password exists in the database.

The query is:

 session
        .run('Match (n:voters) WHERE n.id={idParam} AND n.password={passwordParam} RETURN n',{idParam:username,passwordParam:password})
        .then(function(result){
            result.records.forEach(function(record){
                    console.log(record);
            });
            })
1 REPLY 1

Check for preceding or trailing whitespace both in the parameters, and in the properties on the :voters node you're testing against.

Also make sure your cases match (labels and property names are case sensitive).