简体   繁体   English

使用neo4j-import工具导入数据时,我们可以指定属性的数据类型吗?

[英]Can we specify data types for properties while importing data using neo4j-import tool?

I've imported lot of data using neo4j-import tool only to be useless as the default data type is string for all columns. 我已经使用neo4j-import工具导入了很多数据,只是没有用,因为所有列的默认数据类型都是字符串。 I'm not able to perform any aggregations on data. 我无法对数据执行任何汇总。 However, I'm able to change the data type using update commands but this is a lot of overhead. 但是,我可以使用更新命令来更改数据类型,但这会带来很多开销。

Is it possible specify data types importing data itself using neo4j-import tool? 是否可以指定使用neo4j-import工具导入数据本身的数据类型?

You should be able to use toInt(), toFloat(), and toString(). 您应该能够使用toInt(),toFloat()和toString()。 If you need booleans, you can do a comparison to get a boolean output. 如果需要布尔值,可以进行比较以获得布尔值输出。

Ah, this is assuming that you have access to Cypher in the import. 嗯,这是假设您可以在导入中访问Cypher。

If you're using the 2.2.0 (and probably 3?) import, you should be able to define the type in the header like so propertyName:int 如果您使用的是2.2.0(可能是3?)导入,则应该能够在标头中定义类型,例如propertyName:int

See the property types part of the 2.2.0 import tool docs, and the CSV header format sections. 请参阅2.2.0导入工具文档的属性类型部分,以及CSV标头格式部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM