Skip to content

[BUG] labelFilter for subgraph_all doesn't work as documented #610

@thomas-tran-de

Description

@thomas-tran-de

Describe the bug
In the documentation, examples for subgraph_all are given. Unfortunately, they don't work as described.

To Reproduce
Run the following query:

CREATE (w:Wolf)-[ca:CATCHES]->(d:Dog), (c:Cat), (m:Mouse), (h:Human);
MATCH (w:Wolf), (d:Dog), (c:Cat), (m:Mouse), (h:Human)
WITH w, d, c, m, h
CREATE (d)-[:CATCHES]->(c)
CREATE (c)-[:CATCHES]->(m)
CREATE (d)-[:FRIENDS_WITH]->(m)
CREATE (h)-[:OWNS]->(d)
CREATE (h)-[:HUNTS]->(w)
CREATE (h)-[:HATES]->(m);
MATCH (dog:Dog)
CALL path.subgraph_all(dog, {
    labelFilter: ["/Mouse"]
})
YIELD nodes AS nodes, rels AS rels
RETURN nodes, rels

This returns only a single node, Mouse:

{
  "nodes": [
    { "id": 13, "labels": ["Mouse"], "properties": {}, "type": "node" }
  ],
  "rels": []
}

Expected behavior
According to the documentation, this filtering will return 3 paths: Dog->Cat->Mouse, Dog<-Human->Mouse, Dog->Mouse.

Additional context
I tried this in the newest Memgraph version 3.2.1.

Metadata

Metadata

Assignees

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions