Search code examples
neo4jneo4j-apoc

Can I specify my own identifier ID as the relationship IDs in APOC.export?


Currently, it seems the relationship output by apoc.export function:

 CALL apoc.export.csv.data( [], R, null, {stream:true}) YIELD data AS rdata
    RETURN mdata, ndata, rdata

The format is:

_start  _end    _type 
18701   19076   hasMember

The '18701' & '19076' are neo4j's internal ids. Can I use my own id from the node's identifier as the relationship connector? My own node identifier is always guaranteed to be unique. I want to periodically export KG nodes and relationships as KG grows overtime. In such a case, can the IDs always be unique among all nodes in the entire graph?


Solution

  • The possibility of getting duplicate nodes and relationships when using apoc.import.csv (even when ignoreDuplicateNodes is false, which is the default) is a known issue (see issues 1046 and 1048).

    Unfortunately, issue 1048 was closed by its submitter even though is was not fixed. You may want to open a new issue.