Property keys, types, examples, and constraints

Give each property a key, a property type, and an example value. Mark it Unique or Required to add a constraint.

Key, Type, and Example

Edit properties in the side panel's Edit tab, or double-click a node or relationship to edit them right on the canvas. Either way, you'll see the same three columns:

Add a property in the empty row at the bottom: Tab moves between its fields, and Enter saves the whole row as one undo step. To set the key and type in one go, enter key: TYPE in the Key field, such as orderId: STRING. Cypher's synonyms work too, so quantity: int gets the type INTEGER. Each key can appear only once on a node or relationship, and it can't be all digits.

Unique and Required

At the top of the type list are two checkboxes: Unique adds a property uniqueness constraint, and Required adds a property existence constraint. On the canvas, a required property gets Cypher's ! shorthand for NOT NULL after its type (orderId: STRING!), and a unique property's line ends with the word unique. The Cypher export starts with a CREATE CONSTRAINT … IF NOT EXISTS statement per constraint. Existence constraints need Neo4j Enterprise Edition or Aura; uniqueness constraints work in every edition.

Reorder properties

Drag a row by the dots at its far left, either in the side panel or on the canvas. A line shows where the row will land. Order matters: the top property's example appears inside the node as its caption.

Paste several properties at once

Paste one of these into the Key field of the empty row at the bottom, and we'll add all of its properties in a single undo step:

If a property already exists, we keep its type, example, and constraints and only fill in what's missing. A message sums up the result, such as “Added 3 properties · 1 already existed”.

How properties are drawn and exported

The properties appear in a box below each node and below each relationship's type, one per line: key: TYPE (example), or whichever parts you've filled in. Style the box under Properties in the Format tab, and use the Properties layer in the Layers tab to show or hide every property box at once. In Square mode, each card lists its properties in three columns: key, type, and example.

In the Cypher export, each property's value is its example, written to match its property type, so a DATE example becomes date(…). An example that doesn't fit its type is exported as a string, and a property without an example gets its type name as a placeholder string. Cypher and JSON exports include the properties even when the Properties layer is hidden.

Related