cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

SQL Array type vs. Neo4j

I started to model my database using SQL but I had a problem. I need a field to be an Array of foreign keys but as I searched this is impossible with SQL. Is it possible to do something similar in Neo4j?

CREATE TABLE places (
id SERIAL PRIMARY KEY,
title text NOT NULL,
country integer NOT NULL REFERENCES countries(id),
state integer NOT NULL REFERENCES states(id),
city integer NOT NULL REFERENCES cities(id),
address text,
zipcode text NOT NULL,
services integer REFERENCES services(id)
);

CREATE TABLE services (
id SERIAL PRIMARY KEY,
title text NOT NULL
}

1 REPLY 1

You don't have foreign keys you use relationship instead, which represent 1:1, 1:n or m:n connections.

You can also store arrays of values as properties, but that's unrelated.