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
31 changes: 28 additions & 3 deletions pages/querying/clauses/where.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ order to avoid problems with performance or results.
1.4. [Filter with node properties](#14-filter-with-node-properties)<br />
1.5. [Filter with relationship properties](#15-filter-with-relationship-properties)<br />
1.6. [Check if property is not null](#16-check-if-property-is-not-null)<br />
1.7. [Filter with pattern expressions](#17-filter-with-pattern-expressions)<br />
1.7. [Filter with EXISTS expressions](#17-filter-with-exists-expressions)<br />
1.8. [Filter with pattern expressions](#18-filter-with-pattern-expressions)<br />
2. [String matching](#2-string-matching)<br />
3. [Regular Expressions](#3-regular-expressions)
4. [Existential subqueries](#4-existential-subqueries)<br />
Expand Down Expand Up @@ -166,9 +167,9 @@ Output:
+----------------+----------------+
```

### 1.7. Filter with pattern expressions
### 1.7. Filter with EXISTS expressions

Currently, we support pattern expression filters with the `exists(pattern)`
Currently, we support `EXISTS` expression filters with the `exists(pattern)`
function, which can perform filters based on neighboring entities:

```cypher
Expand All @@ -191,6 +192,30 @@ Output:
+----------------+
```

### 1.8. Filter with pattern expressions

Currently, we support pattern expression filters inside the `WHERE` clause.

```cypher
MATCH (p:Person)
WHERE (p)-[:LIVING_IN]->(:Country {name: 'Germany'})
RETURN p.name
ORDER BY p.name;
```

Output:

```nocopy
+----------------+
| c.name |
+----------------+
| Anna |
| John |
+----------------+
```

The pattern expressions can't contain any additional symbols that are not introduced in the previously matched symbols.

## 2. String matching

Apart from comparison and concatenation operators Cypher provides special
Expand Down
1 change: 1 addition & 0 deletions pages/querying/differences-in-cypher-implementations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ Such a construct is not supported in Memgraph, but you can use `collect()` [aggr

{<h4 className="custom-header">Patterns in expressions</h4>}
Patterns in expressions are supported in Memgraph in particular functions, like `exists(pattern)`.
Memgraph also supports filtering based on patterns, like `MATCH (n) WHERE NOT (n)-->()`.
In other cases, Memgraph does not yet support patterns in functions, e.g. `size((n)-->())`.
Most of the time, the same functionalities can be expressed differently in Memgraph
using `OPTIONAL` expansions, function calls, etc.
Expand Down