CREATE CONSTRAINT ON

Create a property constraint on a node label or relationship type

The CREATE CONSTRAINT ON clause will create a property constraint on all nodes/relationships that have the specified label/type.

The IS UNIQUE property constraint will create an accompanying index.

Reference: schema constraints manual page
Related: :help DROP CONSTRAINT ON :help Schema :help Cypher
CREATE CONSTRAINT ON (p:Person)
ASSERT p.name IS UNIQUE
Create a unique property constraint on the label Person and property name.
CREATE CONSTRAINT ON (p:Person)
ASSERT exists(p.name)
Create a node property existence constraint on the label Person and property name.
CREATE CONSTRAINT ON ()-[l:LIKED]-()
ASSERT exists(l.when)
Create a relationship property existence constraint on the type LIKED and property when.