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


(Paul Drangeid) #1

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


(Michael Hunger) #2

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.


(Michael Hunger) #3

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).


(Paul Drangeid) #4

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