Cypher: Convert String to primitive long

857 views
Skip to first unread message

aldrinm

unread,
Jun 1, 2012, 12:34:16 PM6/1/12
to ne...@googlegroups.com
Is there a way to convert a String to a primitive long in a cypher query? More specifically in a WHERE clause like, WHERE n.stringProperty > 100, I need to convert stringProperty to a number to compare. 
(Actually, I'm using the Grails plugin which converts dates to millisecs and then stores them in the datastore. Unfortunately it stores it as strings)


Thanks,
Aldrin

Peter Neubauer

unread,
Jun 3, 2012, 11:04:32 AM6/3/12
to ne...@googlegroups.com
Mmh,
not that I know of. In that case, that probably should be a function like

INT(x.age)

or so. WDYT Andres? This might be interesting for making sure that
there is an INT coming from a property even if it is Strign on some
nodes. Just thinking aloud here.

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

If you can write, you can code - @coderdojomalmo
If you can sketch, you can use a graph database - @neo4j

Andres Taylor

unread,
Jun 5, 2012, 2:34:26 AM6/5/12
to ne...@googlegroups.com
Yeah, it's in the back log already. https://github.com/neo4j/community/issues/376

Andrés

aldrinm

unread,
Jun 5, 2012, 4:37:42 AM6/5/12
to ne...@googlegroups.com
Ok. Thanks.

(for the moment I'm working around this by storing a shadow field with the required data type)

Cheers,
Aldrin


On Tuesday, 5 June 2012 12:04:26 UTC+5:30, Andres Taylor wrote:
Yeah, it's in the back log already. https://github.com/neo4j/community/issues/376

Andrés
Reply all
Reply to author
Forward
0 new messages