Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-10-2020 12:48 PM
Hello,
Is it possible to create a node based on the properties of an unwind component without explicitly specifying the properties?
so of X is the unwound item I can perform an ON CREATE SET y.* = x.* ??
Thanks!
03-10-2020 09:14 PM
Hi David,
I am not very sure if I understood your requirement
However you can try
with ["1","2"] as list unwind list as a Create(n:AskedNode) return n
03-11-2020 01:23 AM
Hello,
Here's what I'd like to do.. set all of y to the same properties as item...
UNWIND $items AS item
WITH item
MERGE (item: { item.code})-[:HAS_REL]->(y:NEW)
SET y.* = item.*
RETURN y
04-11-2021 03:33 AM
Yes - if I understand your question correctly.
MATCH (o:OtherNode {name: 'unique name'})
WITH o
UNWIND $items as item
CREATE (i:Item)-[:HAS_REL]->(o)
SET i = item
RETURN i, o
you can test it from the browser with by creating the OtherNode
:
CREATE (o:OtherNode {name: 'unique name'})
and setting params
like so:
:params {items: [{foo: "foo", bar: "bar"}, {baz: 'baz'}]}
Also see Set all properties using a parameter
All the sessions of the conference are now available online