What data types are supported in Memgraph? Is there a difference between node and relationship types? Do I need to define data type in similar way that you define variable types in programing languages?
1 Answers
Memgraph stores all of the data in nodes and relationships. There are some important differences when it comes to them:
Nodes can have labels that are used to label or group nodes. A label is of the type
String
, and each node can have none or multiple labels. Labels can be changed at any time.Relationships have a type, also represented in the form of a
String
. Unlike nodes, relationships must have exactly one relationship type and once it is set upon creation, it can never be modified again.
Nodes and relationships can store various properties. Property names are represented as text, while values can be of different types.
Each property can store a single value, and it is not possible to have multiple properties with the same name on a single graph element. But, the same property names can be found across multiple graph elements.
There are no restrictions on the number of properties that can be stored in a single graph element. The only restriction is that the values must be of the supported types.
This are supported data types in Memgraph:
Null
- Property has no value, which is the same as if the property doesn't exist.String
- Character string (text).Boolean
- Boolean value, either true or false.Integer
- Integer number.Float
- Floating-point number (real number).List
- List containing any number of property values of any supported type under a single property name.Map
- Mapping of string keys to values of any supported type.Duration
- Period of time.Date
- Date with year, month, and day.LocalTime
- Time without the time zone.LocalDateTime
- Date and time without the time zone.

- 1,024
- 4
- 22