Nested Maps and Collections in Neo4j 2

前端 未结 2 1798
[愿得一人]
[愿得一人] 2021-01-12 17:57

I understand that node and relationship properties are limited to primitive types or arrays of primitive types. The "Maps" section of the Neo4j 2.1 Reference Card

2条回答
  •  孤城傲影
    2021-01-12 18:19

    (Edited)

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

    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;
    

提交回复
热议问题