Install APOC https://neo4j.com/docs/labs/apoc/current/introduction/#installation for your database. Allow unrestricted access dbms.security.procedures.unrestricted=apoc.* Follow the ideas in the scripts above.
Last active
November 1, 2019 09:27
-
-
Save michael-simons/e2d02d9c3e1365a93a78dbeecf9d4ff5 to your computer and use it in GitHub Desktop.
Detect and migrate string properties of nodes to dedicated types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create (m:Mixed {createdAt: '2015-07-21T21:40:32.142+0100', name:'old'}) | |
create (m:Mixed {createdAt: datetime(), name:'new'}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
match (m:Mixed) | |
where apoc.meta.types(m).createdAt = 'STRING' | |
set m.createdAt = datetime(m.createdAt) | |
RETURN m | |
// See https://neo4j.com/docs/cypher-manual/current/functions/temporal/datetime/#functions-datetime-create-string | |
// for parsing options |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment