Convert string to numbers

16 views
Skip to first unread message

Jessica Marinho

unread,
Feb 6, 2017, 11:58:46 AM2/6/17
to Neo4j
I created a database with many nodes, some nodes store numbers as properties, but these numbers are stored as string, The numbers contain many digits like 43.988399999999999. Can I convert all these strings to numbers?

Michael Hunger

unread,
Feb 6, 2017, 10:06:46 PM2/6/17
to ne...@googlegroups.com
how many nodes do you have?

If it's around 1M this should be fine

match (n) SET n.value = toFloat(n.value)

, if it's more you probably want to batch it

match (n) 
WITH n SKIP 1000000 LIMIT 1000000
SET n.value = toFloat(n.value)

On Mon, Feb 6, 2017 at 5:58 PM, Jessica Marinho <jlmarin...@gmail.com> wrote:
I created a database with many nodes, some nodes store numbers as properties, but these numbers are stored as string, The numbers contain many digits like 43.988399999999999. Can I convert all these strings to numbers?

--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages