Skip to content

NULL

You can set the properties for vertices or edges to NULL. Also, you can set NOT NULL constraint to make sure that the property values are NOT NULL.

If not specified, the property is set to NULL by default.

Logical operations with NULL

The logical operations with NULL is the same as openCypher.

Here is the truth table for AND, OR, XOR, and NOT.

a b a AND b a OR b a XOR b NOT a
false false false false false true
false null false null null true
false true false true true true
true false false true true false
true null null true null false
true true true true false false
null false false null null null
null null null null null null
null true null true null null

OpenCypher compatibility

The comparisons and operations about NULL are different from openCypher.

The behavior may change later.

Comparisons with NULL

The comparison operations with NULL is incompatible with openCypher.

Operations and expression with NULL

The NULL operations and RETURN with NULL is incompatible with openCypher.

Examples

Create a tag named player. Specify the property name with NOT NULL. Ignore the property age constraint.

nebula> CREATE TAG player(name string NOT NULL, age int);
Execution succeeded (time spent 5001/5980 us)

The property name is NOT NULL. The property age is NULL by default.

nebula> SHOW CREATE TAG player;
+-----------+-----------------------------------+
| Tag       | Create Tag                        |
+-----------+-----------------------------------+
| "student" | "CREATE TAG `player` (           |
|           |  `name` string NOT NULL,          |
|           |  `age` int64 NULL                 |
|           | ) ttl_duration = 0, ttl_col = """ |
+-----------+-----------------------------------+
nebula> INSERT VERTEX player(name, age) VALUES "Kobe":("Kobe",null);
Execution succeeded (time spent 6367/7357 us)

Last update: March 25, 2021
Back to top