neo4j在从csv导入期间指定数据类型 [英] neo4j specify data-type during import from csv
问题描述
有没有一种方法可以在导入时告诉neo4j值的类型? 例如,neo4j是否知道"2015-0104T10:33:44"是日期还是字符串?
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?
谢谢!
推荐答案
Neo4j使用Java基本类型,字符串或这些类型的数组作为属性值.没有日期类型.因此,"2015-0104T10:33:44"是一个字符串.
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提供了一些用于类型转换的功能,例如toFloat
,toInt
,...,这些可能会在这里帮助您.
Cypher provides couple of functions for type conversion like toFloat
, toInt
, ... that might help you here.
自纪元以来,大多数人都存储毫秒,以获取日期和时间信息.但是Cypher尚不具备将字符串转换为millis的功能,因此您可能需要在csv文件中的预处理步骤中进行此操作.
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.
这篇关于neo4j在从csv导入期间指定数据类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!