Graph types
All graph types are either structural elements of the graph or projections thereof. None can be stored as a property value.Nodes
Nodes are persistent graph elements that can be connected to each other via relationships. They can have any number of labels that describe their general type. For example, a node representing London may be created with thePlace and City labels and retrieved by queries using either or both of them.
Nodes have sets of properties to describe all of their salient characteristics. For example, our London node may have the property set: {name: 'London', capital: True, elevation: 11}.
When querying nodes, multiple labels can be specified. Only nodes that hold all specified labels will be matched:
Relationships
Relationships are persistent graph elements that connect one node to another. They must have exactly one type that describes what they represent. For example, aRESIDENT_OF relationship may be used to connect a Person node to a City node.
Relationships are always directed, connecting a source node to its destination.
Like nodes, relationships have sets of properties to describe all of their salient characteristics.
When querying relationships, multiple types can be specified by separating them with a pipe (|). Relationships that hold any of the specified types will be matched:
Paths
Paths are alternating sequences of nodes and edges, starting and ending with a node. They are not structural elements in the graph, but can be created and returned by queries. For example, the following query returns all paths of any length connecting the node London to the node New York:Scalar Types
All scalar types may be provided by queries or stored as property values on node and relationship objects.Strings
FalkorDB strings are Unicode character sequences. When using Redis with a TTY (such as invoking FalkorDB commands from the terminal viaredis-cli), some code points may not be decoded, as in:
--raw flag:
Booleans
Boolean values are specified astrue or false. Internally, they are stored as numerics, with 1 representing true and 0 representing false. As FalkorDB considers types in its comparisons, 1 is not considered equal to true:
Integers
All FalkorDB integers are treated as 64-bit signed integers.Floating-point values
All FalkorDB floating-point values are treated as 64-bit signed doubles.Geospatial Points
The Point data type is a set of latitude/longitude coordinates, stored within FalkorDB as a pair of 32-bit floats. It is instantiated using the point() function call.Nulls
In FalkorDB,null is used to stand in for an unknown or missing value.
Since we cannot reason broadly about unknown values, null is an important part of FalkorDB’s 3-valued truth table. For example, the comparison null = null will evaluate to null, as we lack adequate information about the compared values. Similarly, null in [1,2,3] evaluates to null, since the value we’re looking up is unknown.
Unlike all other scalars, null cannot be stored as a property value.
Temporal Types
FalkorDB supports the following temporal types that allow modeling and querying time-related data:- Date - Calendar dates (YYYY-MM-DD)
- Time - Time of day (HH:MM:SS)
- DateTime - Combined date and time
- Duration - Time intervals
Date
Represents a calendar date in the format YYYY-MM-DD. Purpose:Use
Date to store and compare dates without time information, such as birth dates, due dates, or deadlines.
Example:
- Compare using operators (
=,<,>, etc.) - Extract components using functions:
Time
Represents a time of day in the format HH:MM:SS. Purpose:Use
Time to store specific times (e.g., store hours, alarm times) without date context.
Example:
- Compare time values:
- Extract parts:
DateTime
Represents a point in time, combining both date and time. Format: YYYY-MM-DDTHH:MM:SS. Purpose:Use
DateTime when both date and time are relevant, such as logging events, scheduling, or timestamps.
Example:
- Compare with other
DateTimevalues - Extract parts:
- Use
localdatetime()with no arguments to get the current system time:
Duration
Represents a span of time in ISO 8601 Duration format:P[n]Y[n]M[n]DT[n]H[n]M[n]S
Purpose:Use
Duration to represent time intervals, such as “3 days”, “2 hours”, or “1 year and 6 months”.
Example:
- Add/subtract durations with dates or datetimes:
- Add durations together:
- Extract fields:
Collection Types
Arrays
Arrays are ordered lists of elements. They can be provided as literals or generated by functions likecollect(). Nested arrays are supported, as are many functions that operate on arrays such as list comprehensions.
Arrays can be stored as property values provided that no array element is of an unserializable type, such as graph entities or null values.
Maps
Maps are order-agnostic collections of key-value pairs. If a key is a string literal, the map can be accessed using dot notation. If it is instead an expression that evaluates to a string literal, bracket notation can be used:Map projections
Maps can be constructed as projections using the syntaxalias {.key1 [, ...n]}. This can provide a useful format for returning graph entities. For example, given a graph with the node (name: 'Jeff', age: 32), we can build the projection:
Null entity projection: Following the openCypher specification, a map projection on anullentity evaluates tonull— not a map ofnullvalues. This matters most when combiningOPTIONAL MATCHwith map projections andcollect():Because the projection itself isnull,collect()skips it, producing an empty list rather than a list containing a map of nulls.
Map merging
You can combine two maps, where values in the second map will override corresponding values in the first map. For example:Function calls in map values
The values in maps and map projections are flexible, and can generally refer either to constants or computed values:WITH clause instead of being invoked within the map. This restriction is intentional, as it helps to clearly disambiguate the aggregate function calls and the key values they are grouped by:
Next Steps
- Getting Started — Build and query your first graph
- Cypher Language — Learn the query language for working with these data types
- Indexing — Create indexes on properties to speed up queries
- Commands — Full command reference for GRAPH.QUERY and more
Frequently Asked Questions
What data types can be stored as node or relationship properties?
What data types can be stored as node or relationship properties?
You can store strings, booleans, integers (64-bit signed), floating-point values (64-bit doubles), geospatial points, and temporal types (Date, Time, DateTime, Duration) as property values. Lists and maps can also be returned by queries. Note that
null and graph structural types (nodes, relationships, paths) cannot be stored as properties.How does FalkorDB handle null values?
How does FalkorDB handle null values?
FalkorDB uses three-valued logic for
null. Since null represents an unknown value, comparisons like null = null evaluate to null (not true). Similarly, null in [1,2,3] evaluates to null. The null value cannot be stored as a property value.Are boolean values and integers interchangeable in FalkorDB?
Are boolean values and integers interchangeable in FalkorDB?
No. While booleans are stored internally as numerics (1 for true, 0 for false), FalkorDB considers types in comparisons. The expression
1 = true evaluates to false because they are different types.What temporal types does FalkorDB support?
What temporal types does FalkorDB support?
FalkorDB supports four temporal types following ISO 8601: Date (YYYY-MM-DD), Time (HH:MM:SS with timezone), DateTime (combined date and time), and Duration (time intervals). You can compare them with standard operators and extract components like
.year, .month, .day.Can I use lists and maps in FalkorDB?
Can I use lists and maps in FalkorDB?
Yes. Lists are ordered collections that can contain mixed types including nested lists. Maps are key-value pairs that can be constructed in queries or used as map projections from nodes. Both can be returned by queries but have some restrictions when used in property storage.