Skip to content
Merged
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
13 changes: 13 additions & 0 deletions pages/querying/expressions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,19 @@ The general syntax for list comprehension in Cypher is:
- **`predicate`** (optional): A condition that filters elements; only elements satisfying this condition are processed.
- **`expression`**: An expression applied to each filtered element; the results form the new list.

When the predicate is `null` for an element, that element is skipped and the
other elements are still returned, the same as when the predicate is `false`.
A list that contains `null`, or a property that an element does not have, does
not turn the whole result into `null`:

```cypher
RETURN [x IN [1, null, 3] WHERE x > 0 | x] AS positives
```

**Result:** `[1, 3]`

If the list itself is `null`, the result is `null`.

**Examples:**

1. **Transforming a list:**
Expand Down