Skip to content

Cypher: subquery where clause seems to be always returning false #3769

Closed

Description

@Orkie

A slightly odd looking-query, but I've tried to boil the pattern down to the smallest possible example.

MERGE (t1:Thing1 {username: "bob"}) WITH coalesce(t1.aList, []) AS aList
CALL {
  WITH aList WITH aList
  WHERE NOT any(element IN aList WHERE element = "92dc13ff-50d1-4879-b2fd-b0dedf7ec019")
  RETURN true AS success1
}
RETURN success1

When run against a blank DB Neo4j returns:

Neo4j returns
╒════════╕
│success1│
╞════════╡
│true    │
└────────┘

ArcadeDB returns nothing.

The parts in isolation seem to work, but something is going wrong when in a CALL subroutine with the WHERE clause.

# returns true
MERGE (t1:Thing1 {username: "bob"}) WITH coalesce(t1.aList, []) AS aList
RETURN NOT any(element IN aList WHERE element = "92dc13ff-50d1-4879-b2fd-b0dedf7ec019")

#returns false
MERGE (t1:Thing1 {username: "bob"}) WITH coalesce(t1.aList, ["92dc13ff-50d1-4879-b2fd-b0dedf7ec019"]) AS aList
RETURN NOT any(element IN aList WHERE element = "92dc13ff-50d1-4879-b2fd-b0dedf7ec019")

# returns true
MERGE (t1:Thing1 {username: "bob"}) WITH coalesce(t1.aList, []) AS aList
CALL {
  WITH aList WITH aList
  RETURN true AS success1
}
RETURN success1

Activity

  1. self-assigned this
    on Apr 2, 2026
  2. added theissue type on Apr 2, 2026
  3. added this to the 26.4.1 milestone on Apr 2, 2026
  4. lvca commented on Apr 2, 2026

    @lvca
    Member

    Reproduced and fixed

  5. Orkie commented on Apr 2, 2026

    @Orkie
    Author

    Thanks, just checked and it's working fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions