2014-03-05 49 views
0
使用来自于ExtJS的功能Ext.Ajax.request一个暗号查询到的Neo4j REST API的请求时,我有问题

,这里是我的代码:如何使用Ext.Ajax.request通过Neo4j REST API调用Cypher查询?

values.query="MATCH (x { username: {username}, password: {password} }) RETURN x"; 

Ext.Ajax.request({ 
    url: "http://localhost:7474/db/data/cypher", 
    params: values, 
    success: successCallback, 
    failure: failureCallback 
}); 

我越来越从德的下一个响应服务器

responseText: "{↵ "message" : "The statement has been closed.",↵ "exception" : "BadInputException"... 
+1

你是如何传递帕拉姆值(用户名,密码)? – Luanne

+0

当通过ajax传递这些值时,我担心安全问题。 –

回答

0

你可以试试这个:

MATCH (x) where x.username= {username} and x.password= {password} RETURN x 

尝试使用标签为好,因为只有节点属性的工作是太慢。 您可以在节点x上设置标签,例如帐户。 随着

MATCH (x) where x.username= {username} and x.password= {password} set (x:account) RETURN x 

,并寻找它时,你会用

MATCH (x:account) where x.username= {username} and x.password= {password} RETURN x 

希望它可以帮助