You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@hop.apache.org by po...@gmx.com on 2024/03/12 09:17:09 UTC
How to use parameters in "Neo4j Cypher"?
Hello dear Hop users!
Could you please tell me how to use parameters in "Neo4j Cypher"?
In Parameters tab I have:
productid (parameter), product_id (Field), Integer (Neo4j Type)
'product_id' comes from csv file collumn - hop earlier.
My query is something like:
MATCH path = (....)
WHERE (product.product_id = {productid})
Does not work although according to manual, 'parameter substitution (for
example `{MY_PARAMETER}' `it should:
https://hop.apache.org/manual/latest/pipeline/transforms/neo4j-cypher.html
I tried also:
WHERE (product.product_id = ${productid})
WHERE (product.product_id = ?)
None works
So, what is the correct syntax?
Regards!
Re: How to use parameters in "Neo4j Cypher"?
Posted by po...@gmx.com.
Thank you very much for help - it works.
U're right obout parameter names - here it was productId not productid :-)
**Sent:** Tuesday, March 12, 2024 at 12:02 PM
**From:** "Geoffrey Cleaves" <gc...@gmail.com>
**To:** users@hop.apache.org
**Subject:** Re: How to use parameters in "Neo4j Cypher"?
Try simply $productid.
Beware that Hop is opinionated about what your parameters should look like and
will rewrite field names which have an underscore. For example, field my_field
will be renamed to myField in the Neo4j Cypher transform.
On Tue, 12 Mar 2024, 10:18 , <[podunk@gmx.com](mailto:podunk@gmx.com)> wrote:
>
>
> Hello dear Hop users!
>
>
>
> Could you please tell me how to use parameters in "Neo4j Cypher"?
>
> In Parameters tab I have:
>
>
>
> productid (parameter), product_id (Field), Integer (Neo4j Type)
>
> 'product_id' comes from csv file collumn - hop earlier.
>
>
>
> My query is something like:
>
>
>
> MATCH path = (....)
>
> WHERE (product.product_id = {productid})
>
>
>
>
>
> Does not work although according to manual, 'parameter substitution (for
> example `{MY_PARAMETER}' `it should:
> <https://hop.apache.org/manual/latest/pipeline/transforms/neo4j-cypher.html>
>
> I tried also:
>
>
>
> WHERE (product.product_id = ${productid})
>
> WHERE (product.product_id = ?)
>
>
>
> None works
>
>
>
> So, what is the correct syntax?
>
>
>
> Regards!
>
>
Re: How to use parameters in "Neo4j Cypher"?
Posted by Geoffrey Cleaves <gc...@gmail.com>.
Try simply $productid.
Beware that Hop is opinionated about what your parameters should look like
and will rewrite field names which have an underscore. For example, field
my_field will be renamed to myField in the Neo4j Cypher transform.
On Tue, 12 Mar 2024, 10:18 , <po...@gmx.com> wrote:
>
> Hello dear Hop users!
>
> Could you please tell me how to use parameters in "Neo4j Cypher"?
> In Parameters tab I have:
>
> productid (parameter), product_id (Field), Integer (Neo4j Type)
> 'product_id' comes from csv file collumn - hop earlier.
>
> My query is something like:
>
> MATCH path = (....)
> WHERE (product.product_id = {productid})
>
>
> Does not work although according to manual, 'parameter substitution (for
> example {MY_PARAMETER}' it should:
> https://hop.apache.org/manual/latest/pipeline/transforms/neo4j-cypher.html
> I tried also:
>
> WHERE (product.product_id = ${productid})
> WHERE (product.product_id = ?)
>
> None works
>
> So, what is the correct syntax?
>
> Regards!
>
>