cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

How to specify relationship property when using apoc.merge.relationship?

lingvisa
Graph Fellow
MATCH (h:Product{_ID: row._start})
MATCH (t:Product{_ID: row._end})
CALL apoc.merge.relationship(h, row._type, { _rank:row._rank}, {}, t, {}) yield rel
RETURN rel

My relationship format is below, for example:

_start _end _type _rank

001 100 competitiveProduct 3

I want to specify that 'row._rank' is an integer.

1 ACCEPTED SOLUTION

clem
Graph Steward

Change:
{ _rank:row._rank}
to:
{ _rank:toInteger(row._rank)}

For other useful scalar functions, see: https://neo4j.com/docs/cypher-manual/current/functions/scalar/

View solution in original post

1 REPLY 1

clem
Graph Steward

Change:
{ _rank:row._rank}
to:
{ _rank:toInteger(row._rank)}

For other useful scalar functions, see: https://neo4j.com/docs/cypher-manual/current/functions/scalar/