Can a collection be owned by Neo4j?

Is there a way to include a collection as a property in Neo4j? And if so, is this a circuit that matches the basic philosophy of Neo4j?

The main reason I am interested in node like this is because I can code the idea of ​​a sequence of actions. In this case, breakfast, lunch, and then dinner. Of course, I do not want 3 separate nodes for each meal. It also makes no sense to have 3 relationships, which are nutrition, because they are not going to communicate with anyone.

I am trying to develop something like this:

CREATE (:Node {name: 'John Doe', food: [{breakfast: ['cereal', 'juice']}, {lunch: ['sandwich', 'milk']}, {dinner: ['M&Ms']}])

All my attempts of something of this nature led to the following errors:

Property values can only be of primitive types or arrays thereof
or
Collections containing mixed types can not be stored in properties.

This led me to believe that this type of structure is not a good idea, and I suppose there is a good reason.

+4
2

?

.

node ( ) 3 :

CREATE (:Person {name: 'John Doe', 
          breakfast: ['cereal', 'juice'], 
          lunch: ['sandwich', 'milk'], 
          dinner: ['M&Ms']})

food.* .

+4
  • , .

  • : . :

    • ?
    • ?
    • , ?
    • ?
    • ?
    • ?
    • , ?

:

enter image description here

0

All Articles