cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Unable to match on unwound list of nested parameters

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

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

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