Wrong key parsing in Builder._addWhereParameter()
gueno-dev opened this issue · 0 comments
gueno-dev commented
Hi, I noticed a strange bug in the _addWhereParameter method.
This method create a unique key at this point :
Line 138 in f853284
If the node alias includes a special char like "_", this unique key is broken because the regex only match the first occurrence of special chars. This behavior throw an error in Neo4j.
Example :
For alias = p :
{
query: 'MATCH (p:ResourceContent) WHERE (p.title = $where_p_title) RETURN p',
params: { where_p_title: 'My title' }
}
--> No problem, this query works.
For alias = p_p :
{
query: 'MATCH (p_p:ResourceContent) 'WHERE (p_p.title = $where_p_p.title) RETURN p_p',
params: { 'where_p_p.title': 'My title' }
}
--> A point is still present in the variable and it's throw an error :
Neo4jError: Expected parameter(s): where_p_p
I submit a fix, could you merge it, please ? Thanks :)