Search code examples
typesneo4jcypherload-csv

neo4j specify data-type during import from csv


is there a way to tell the neo4j the type of the value when importing? for example, does the neo4j knows if "2015-0104T10:33:44" is a date or string?

thanks!


Solution

  • Neo4j uses java primitive types, Strings or arrays of those for property values. There is no date type. So "2015-0104T10:33:44" is a String.

    Cypher provides couple of functions for type conversion like toFloat, toInt, ... that might help you here.

    Most folks store millis since epoch for date and time information. However Cypher does not yet have a function to convert a string to millis, so you're doing this probably in a pre-processing step in your csv files.