close
Skip to content

Cypher: adding constant string value to list with + operator does not work #3771

@Orkie

Description

@Orkie

If you try to add a string constant to a list using the + operator, the string addition seems to take precedence over the list when resolving how to apply the operator

# returns "[]a" (wrong)
return []+"a"

# returns "a[]" (wrong)
return "a"+[]

# returns ["a"] (correct)
return []+["a"]

Neo4j:

# returns ["a"]
return []+"a"

# returns ["a"]
return "a"+[]

# returns ["a"]
return []+["a"]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions