Closed saurabhkumar closed 1 month ago
@saurabhkumar Thanks for reporting. We will investigate further and come back to you.
Best regards Louise, Neo4j
Hi!
This isn't a bug, Unique constraints are required to be able to do importing as the error is saying. The linked bug was that this error would happen, and any constraint that was made (e.g an existence constraint) would be accepted, which was incorrect as the constraint must be a uniqueness one.
Unfortunately, the procedure has WRITE
mode and not SCHEMA
mode, so it is not possible for this behaviour to change. I do see that this is not properly documented, and will amend that :)
Just to be clear, a unique constraint is needed for every imported node/relationship label/type on the importing id. The error message will let you know when a constraint has been missed.
Expected Behavior (Mandatory)
The json files exported using apoc.export.json.all should get imported using apoc.import.json
Actual Behavior (Mandatory)
The error related to constraint check is getting generated even though it should have been fixed as per the fix for the issue 2930
How to Reproduce the Problem
Environment:: docker Image: neo4j- 5.23.0-community-bullseye image
Docker compose file:
Steps
CALL apoc.export.json.all("jsonfile.json")
docker exec -it <container id> /bin/bash
and then check the import folder) that the json file exported earlier is available in the import folderCALL apoc.import.json("jsonfile.json")
Currently used versions
Versions