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.

Data type on import

For neo4j-admin import, if I have a header file that looks like this:

userid:ID,zipcode:int

Is there any way I can cast my userID as long? Perhaps in the relationship file? Something like this

:START_ID:long, :END_ID:long

The userIDs are rather lengthy strings so id like to cast them to longs to save space

1 REPLY 1

You can use globally --id-type integer but that's for all ids.
Afaik it's not possible per type.

You could change it later, .e.g. with

call apoc.periodic.iterate("
MATCH (u:User) RETURN u
","
SET u.userid = toInteger(u.userid)
",{batchSize:10000,iterateList:true, parallel:true})