Showing results for 
Search instead for 
Did you mean: 

Apoc.merge.relationship - permitted range [0,65535]


Test system :
Neo4j community server 4.3.6 on CentOS7 - browser

In test system

call db.relationshipTypes() yield relationshipType return count(relationshipType) as numRelTypes;

Run the script as below :
( inland_route.csv file's rows are under 500 rows)

:param relType => ("INLAND_GOES_TO");

load csv with headers from "file:///Inland_Route.csv" as row
match ((orgYard:Yard {ydCd: row.LNK_ORG_NOD_CD}))
match ((dstYard:Yard {ydCd: row.LNK_DEST_NOD_CD}))
call apoc.merge.relationship(orgYard,
$relType ,
routOrgNodCd: row.ROUT_ORG_NOD_CD,
routDestNodCd: row.ROUT_DEST_NOD_CD,
routSeq: row.ROUT_SEQ,
routDtlSeq: row.ROUT_DTL_SEQ
lnkOrgNodCd: row.LNK_ORG_NOD_CD,
lnkDestNodCd: row.LNK_DEST_NOD_CD,
prioSeq: row.PRIO_SEQ,
pctlIoBndCd: row.PCTL_IO_BND_CD,
trspModCd: row.TRSP_MOD_CD,
vndrSeq: row.VNDR_SEQ,
vndrNm: row.VNDR_NM
) yield rel
return rel

An error occurred as below

I know the error is caused as a result of hitting the maximum number of relationship types for db.
However It looks like the 65536 limit has not been reached from the query.


Graph Fellow


This is weird, with the same $relType this should not happen.
Please, can you provide the .csv used in order to replicate the issue, and your apoc version (executing RETURN apoc.version())?

I think my system is weird.

call db.relationshipTypes() yield relationshipType return count(relationshipType) as numRelTypes;

create (p:Person {name : 'haid'});
create (h:Home {name : 'myhome'});

CREATE (a)-[:OWN]->(h)


It looks like after reaching the max relationship type number,
even after deleting some types, the error remains (I think because the internal relationship type id increment for each creation, it doesn't matter if some have been deleted).
I don't know how this happened, however I would suggest you to create a new database and import there what you need.

Thanks for the kind information.

Nodes 2022
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online