Skip to content

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

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

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