Skip to content

Instantly share code, notes, and snippets.

View mbusch's full-sized avatar

Maximilian Busch mbusch

View GitHub Profile
@mbusch
mbusch / ecommerce-example-beginnning-neo4j.cql
Created January 14, 2016 10:09 — forked from chrisdkemper/ecommerce-example-beginnning-neo4j.cql
This is an example Ecommerce data structure from the book Beginning Neo4j (tested with Neo4j v2.2.8)
//Add some contstraints for good measture, constraints must be ran individually
CREATE CONSTRAINT ON (c:Customer) ASSERT c.email IS UNIQUE;
CREATE CONSTRAINT ON (p:Product) ASSERT p.uuid IS UNIQUE;
//:Start Product and customer query:
//Products, bundles and categories
CREATE (product1:Product {name: "Product 1", uuid: "d8d177cc-1542-11e5-b60b-1697f925ec7b", price: 10})
CREATE (product2:Product {name: "Product 2", uuid: "d8d17b28-1542-11e5-b60b-1697f925ec7b", price: 20})
CREATE (product3:Product {name: "Product 3", uuid: "d8d17c72-1542-11e5-b60b-1697f925ec7b", price: 30})