Nested Maps and Collections in Neo4j 2

2 answers

(Edited)

The reference card is a little too thin. The most important word is literal. In other words, you can use arbitrarily nested maps and arrays in literals, but you cannot store such things in a node or relation.

For example, this works:

 WITH {name:'Alice', age:38, address:[{city:'London', residential:true}, {city: 'Paris', residential: false} ]} AS x RETURN x; 

But this fails:

 CREATE (x {name:'Alice', age:38, address:[{city:'London', residential:true}, {city: 'Paris', residential: false} ]}) RETURN x; 
+4
source

There is a way to do this by converting nested maps to a json string. Answered here

0
source

Source: https://habr.com/ru/post/1202173/


All Articles