Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-19-2019 02:49 AM
Dear Everyone,
I am a newbie (February 2019) transferring my Amazon product database from Filemaker to Neo4J. On the Amazon platform they use an acronym ASIN (Amazon Standard Identification Number).
As a newbie I named one of my properties in the Neo4j database ASIN, only to now find out it is a function in Neo4j (also was the reason I couldn't match based on ASIN, took a few days to figure that one out.)
How do I rename all the property labels on all the product nodes? I couldn't find anything in the documentation.
Thank you in advance.
Kind regards,
Jeffrey
03-19-2019 04:21 AM
Use SET/REMOVE, like this:
create (:TestRecord { oldName: 'Hello' });
match (t:TestRecord)
SET t.newName = t.oldName
REMOVE t.oldName
return true;
match (t:TestRecord) return t.newName;
03-20-2019 12:01 PM
Hello David,
Thank you for the explanation.
Am I to understand that the SET will automatically make the property when used in the way you posted it?
And what was the reasoning behind using the "RETURN true;"
Jeffrey
03-21-2019 04:54 AM
Yes, SET will create a new property on the node. So we're really not "renaming" a property, we're creating a new one and deleting the old one (same thing).
There's no reasoning behind "RETURN true". You could omit this and there'd be no harm. I was just thinking return true to signal to the caller that the query had executed.
03-21-2019 11:44 AM
Hello David,
Could you elaborate a bit on the concept of "signal the caller that the query had executed"
Thanks in advance,
Jeffrey
All the sessions of the conference are now available online