As you can see in the picture, I have some mistake so I have the same properties but the differrent name such as:
-fromDate and fromdate.
-listingDate and listingdate.
How can I denomolize and remove these duplication?
Thanks
How can I denomolize and remove these duplication?
Thanks
MATCH (a:Person)
Remove a.fromDate and fromdate
RETURN a
This would remove both properties
MATCH (n:SomeLabel)
REMOVE n.fromDate, n.fromdate
If you want to choose one of the 2 properties as the right one, you can do something like:
MATCH (n:SomeLabel)
WHERE NOT n.fromdate IS NULL
SET n.fromDate = n.fromdate
REMOVE n.fromdate
It clearly says "no records". Look at this:
If you are on a new-ish version of Neo4j database, you'd see a warning as well:
To delete properties from nodes or relationships in Neo4j, you can use the REMOVE clause in Cypher. Here are some examples:
Delete a Property from a Node:MATCH (n:NodeLabel)
REMOVE n.propertyName
This command will remove the propertyName
property from all nodes with the label NodeLabel
.
Delete a Property from a Relationship:
MATCH ()-[r:RELATIONSHIP_TYPE]->()
REMOVE r.propertyName
MATCH ()-[r:RELATIONSHIP_TYPE]->()
REMOVE r.propertyName
This will remove the propertyName
property from all relationships of type RELATIONSHIP_TYPE
.
Remove Multiple Properties:
MATCH (n:NodeLabel)
REMOVE n.property1, n.property2
property1
and property2
from the nodes.Deleting properties in this way will leave the node or relationship intact while removing only the specified properties.