@@ -38,11 +38,13 @@ For the full command syntax to create a property uniqueness constraint, see xref
3838======
3939
4040.Create a constraint requiring `Book` nodes to have unique `isbn` properties
41+ // tag::schema_constraints_property_uniqueness[]
4142[source, cypher]
4243----
4344CREATE CONSTRAINT book_isbn
4445FOR (book:Book) REQUIRE book.isbn IS UNIQUE
4546----
47+ // end::schema_constraints_property_uniqueness[]
4648
4749.Result
4850[source, queryresult]
@@ -106,11 +108,13 @@ Added 1 constraint.
106108======
107109
108110.Create a constraint requiring `PREQUEL_OF` relationships to have unique combinations of `order` and `author` properties
111+ // tag::schema_constraints_composite_property_uniqueness[]
109112[source, cypher]
110113----
111114CREATE CONSTRAINT prequels
112115FOR ()-[prequel:PREQUEL_OF]-() REQUIRE (prequel.order, prequel.author) IS UNIQUE
113116----
117+ // end::schema_constraints_composite_property_uniqueness[]
114118
115119.Result
116120[source, queryresult]
@@ -183,11 +187,13 @@ It is not possible to create composite existence constraints on several properti
183187======
184188
185189.Create a constraint requiring `Author` nodes to have a `name` property
190+ // tag::schema_constraints_property_existence[]
186191[source, cypher]
187192----
188193CREATE CONSTRAINT author_name
189194FOR (author:Author) REQUIRE author.name IS NOT NULL
190195----
196+ // end::schema_constraints_property_existence[]
191197
192198.Result
193199[source, queryresult]
@@ -301,11 +307,13 @@ Added 1 constraint.
301307======
302308
303309.Create a constraint requiring `order` properties on `PART_OF` relationships to be of type `INTEGER`
310+ // tag::schema_constraints_property_type[]
304311[source, cypher]
305312----
306313CREATE CONSTRAINT part_of
307314FOR ()-[part:PART_OF]-() REQUIRE part.order IS :: INTEGER
308315----
316+ // end::schema_constraints_property_type[]
309317
310318.Result
311319[source, queryresult]
@@ -324,11 +332,13 @@ A closed dynamic union allows a node or relationship property to maintain some t
324332======
325333
326334.Create a constraint requiring `tagline` properties on `Movie` nodes to be either of type `STRING` or `LIST<STRING NOT NULL>`
335+ // tag::schema_constraints_property_type_dynamic_union[]
327336[source, cypher]
328337----
329338CREATE CONSTRAINT movie_tagline
330339FOR (movie:Movie) REQUIRE movie.tagline IS :: STRING | LIST<STRING NOT NULL>
331340----
341+ // end::schema_constraints_property_type_dynamic_union[]
332342
333343.Result
334344[source, queryresult]
@@ -471,11 +481,13 @@ For the full command syntax to create a key constraint, see xref:constraints/syn
471481======
472482
473483.Create a constraint requiring `Director` nodes to have a unique `imdbId` property as a node key.
484+ // tag::schema_constraints_key[]
474485[source, cypher]
475486----
476487CREATE CONSTRAINT director_imdbId
477488FOR (director:Director) REQUIRE (director.imdbId) IS NODE KEY
478489----
490+ // end::schema_constraints_key[]
479491
480492.Result
481493[source, queryresult]
@@ -539,11 +551,13 @@ Added 1 constraint.
539551======
540552
541553.Create a constraint requiring `KNOWS` relationships to have a unique combination of `since` and `how` properties as a relationship key
554+ // tag::schema_constraints_composite_key[]
542555[source, cypher]
543556----
544557CREATE CONSTRAINT knows_since_how
545558FOR ()-[knows:KNOWS]-() REQUIRE (knows.since, knows.how) IS RELATIONSHIP KEY
546559----
560+ // end::schema_constraints_composite_key[]
547561
548562.Result
549563[source, queryresult]
@@ -609,11 +623,13 @@ All constraint types can be created with a parameterized name.
609623----
610624
611625.Create a node property uniqueness constraint with a parameterized name
626+ // tag::schema_constraints_parameter[]
612627[source, cypher]
613628----
614629CREATE CONSTRAINT $name
615630FOR (book:Book) REQUIRE book.prop1 IS UNIQUE
616631----
632+ // end::schema_constraints_parameter[]
617633
618634.Result
619635[source, queryresult]
0 commit comments