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.

Returning data from a CSV import and confused by 'Any' variable type

pdrangeid
Graph Voyager

I'm returning a list of software vendors, applications, versions, and the version string appears correct when I RETURN the row, but when I attempt to manipulate it as a a string I get an error:

Neo.ClientError.Statement.SyntaxError: Type mismatch: expected String but was Any (line 19, column 230 (offset: 1607))

If I try to toString(version) I get this:

Neo.ClientError.Statement.SyntaxError: Type mismatch: expected Boolean, Float, Integer, Point, String, Duration, Date, Time, LocalTime, LocalDateTime or DateTime but was Any

What the heck is variable type "Any" and how can I deal with this?

edit - I used apoc.meta.type(version) and it always returns the type as "STRING", yet these error persist

3 REPLIES 3

It's about what the "cypher-compiler" knows about that type.
Not at runtime but compile-time.
There is an apoc.convert.toString() function which does the right thing.

What kind of CSV import are you using?
In apoc I added a second pair of columns that have the string values of things.

Unfortunately the difference between compile and runtime-type checking reduces the value of the converter in apoc.load.csv a bit (except if you assign the values directly to an entity).

I am using the apoc csv import. I'll check out the apoc conversion function. Thanks!