Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-14-2019 11:32 PM
I want to define constant values in a cypher query and use it multiple times inside different statements. Is that possible ? How can I do that ?
Solved! Go to Solution.
03-14-2019 11:40 PM
I think I just find it. WITH statement can be used for such purpose
WITH round(rand()*10000000) as d1
MATCH ()-[e]-()
WHERE NOT EXISTS(e['start_time'])
SET e.start_time = d1
return e
limit 1
03-14-2019 11:40 PM
I think I just find it. WITH statement can be used for such purpose
WITH round(rand()*10000000) as d1
MATCH ()-[e]-()
WHERE NOT EXISTS(e['start_time'])
SET e.start_time = d1
return e
limit 1
03-15-2019 09:30 AM
You've got it.
Let me frame it differently for you -- Cypher doesn't really do variable assignment, so just about everything is a constant in cypher, in that you can't mutate variables, unless you alias them under other names.
All the sessions of the conference are now available online