cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to match on unwound list of nested parameters

Keith_gamble
Node Clone

I am having an issue running a query (that works in my dev environment but doesn't seem to in my production environment) and I have simplified it to the following for example:

UNWIND $batch as row
MATCH (leg:Leg {SYS_I: row.props.SYS_I})
RETURN leg

Here is a simplified example of my $batch parameter (Note, there are more things in props, hence why its nested, I just removed them for readability):

:params batch => "[{'props': {'SYS_I': 1919176.0}, 'from': '137', 'to': '137'}, {'props': {'SYS_I': 1923475.0}, 'from': '111', 'to': '111'}]"

I receive the following Neo Client Syntax Error

Type mismatch: expected Map, Node, Relationship, Point, Duration, Date, Time, LocalTime, LocalDateTime or DateTime but was String (line 2, column 24 (offset: 44))
"MATCH (leg:Leg {SYS_I: row.props.SYS_I})"           ^

Prod Version: 4.2.3 Community
Dev Version: 4.2.4 Community

I appreciate any help!

1 ACCEPTED SOLUTION

Cobra
Ninja
Ninja

Hello @Keith.gamble

There is a difference between:

:params batch => "[{'props': {'SYS_I': 1919176.0}, 'from': '137', 'to': '137'}, {'props': {'SYS_I': 1923475.0}, 'from': '111', 'to': '111'}]"

And

:params batch => [{'props': {'SYS_I': 1919176.0}, 'from': '137', 'to': '137'}, {'props': {'SYS_I': 1923475.0}, 'from': '111', 'to': '111'}]

The first is a string while the second is a list, the second should work

Regards,
Cobra

View solution in original post

1 REPLY 1

Cobra
Ninja
Ninja

Hello @Keith.gamble

There is a difference between:

:params batch => "[{'props': {'SYS_I': 1919176.0}, 'from': '137', 'to': '137'}, {'props': {'SYS_I': 1923475.0}, 'from': '111', 'to': '111'}]"

And

:params batch => [{'props': {'SYS_I': 1919176.0}, 'from': '137', 'to': '137'}, {'props': {'SYS_I': 1923475.0}, 'from': '111', 'to': '111'}]

The first is a string while the second is a list, the second should work

Regards,
Cobra

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.