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

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.

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

For other useful scalar functions, see: Scalar functions - Cypher Manual

1 Like