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:
- Key – the property key, such as
orderId. - Type – a dropdown with Neo4j's 13 property types (BOOLEAN, DATE, DURATION, FLOAT, INTEGER, LOCAL DATETIME, LOCAL TIME, POINT, STRING, UUID, VECTOR, ZONED DATETIME, ZONED TIME) and a LIST version of each one except VECTOR (LIST<STRING> and so on). The most common types come first, then the rest in alphabetical order. Type the first few letters to jump to a type.
- Example – a sample value, such as
ORD-1001.
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:
- JSON, a Cypher map, or a list of objects. Each value becomes the property's example, and we work out the property type from it: INTEGER, FLOAT, BOOLEAN, DATE, LOCAL DATETIME, or ZONED DATETIME; a LIST type when every item in a list has the same type; and STRING for any other text.
-
A SQL
CREATE TABLEstatement. Column types map to property types.NOT NULLmakes a property Required,UNIQUEmakes it Unique, and a single-column primary key makes it both. -
A table copied from a spreadsheet or database tool, with or without a
header row, and with tabs, commas, or
|between cells. The output ofDESCRIBEworks too. - Lines such as
key: TYPE (example)orkey: value.
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.