Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/content/docs/cypher/expressions/node-rel-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The following functions are used to get information about nodes and relationship
| `ID` | returns the internal ID of node/rel | |
| `LABEL` | returns the label name of node/relationship | `LABELS` |
| `OFFSET` | returns the offset of the internal ID | |
| `PROPERTIES` | returns a struct of all user-defined properties of node/rel | |

See below for more details on each of these functions.

Expand Down Expand Up @@ -77,3 +78,25 @@ MATCH (a) RETURN OFFSET(ID(a)) AS OFFSET LIMIT 1;
│ 0 │
└────────┘
```

## PROPERTIES

Returns a `STRUCT` containing all user-defined properties of a node or relationship, omitting internal metadata columns (`_ID`, `_LABEL`, `_SRC`, `_DST`).

| Input type | Output type |
| --- | --- |
| `NODE` | `STRUCT` |
| `REL` | `STRUCT` |

```cypher
MATCH (a:User {name: 'Alice'}) RETURN PROPERTIES(a) AS props;
```

```table
┌───────────────────────────────────────────┐
│ props │
│ STRUCT(name STRING, age INT64) │
├───────────────────────────────────────────┤
│ {name: Alice, age: 30} │
└───────────────────────────────────────────┘
```
1 change: 1 addition & 0 deletions src/content/docs/cypher/expressions/struct-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ The functions that can be used with structs are as follows:
| Function | Description | Example | Result |
| ----------- | ----------- | ----------- | ----------- |
| `struct_extract(struct, 'field_name')` | Extracts named field from struct | `struct_extract({name: 'Alice', age: 20}, 'name')` | `'Alice'` |
| `properties(struct)` | Returns the struct of properties | `properties({name: 'Alice', age: 20})` | `{name: Alice, age: 20}` |

</div>
Loading