Reputation: 28611
I'm just starting to learn Neo4j and I've just stumbled across some issue.
It looks like Neo4j is using strong typing without on the fly type conversion, i.e. RETURN '17' = 17
results in false
and RETURN '10' > 5
results in syntax error.
It looks very strange to me for NoSQL and schema-less database to implement such a strict behavior. Even strong typed schema-based databases such as MySQL and Postgresql allows type conversions in statements. Is this an ideology behind Neo4j? If so why?
Upvotes: 0
Views: 60
Reputation: 41676
In Neo4j 2.1 there were type conversion functions added, like toInt
and toFloat
that take care of the conversion.
In 2.0.x you can use str(17) = str('17')
in the other direction.
Neo4j itself is less strict on structural information. But more strict on values. I.e. the value you put into a property is returned exactly like that and you have to convert it to a different type yourself. Some of that stems from its Java history and was already loosened for cypher.
Upvotes: 1