Neo4j+Gremlin : Trouble with T.gte and floating point node attributes

Posted by letronje on Stack Overflow See other posts from Stack Overflow or by letronje
Published on 2012-11-27T05:01:28Z Indexed on 2012/11/27 5:04 UTC
Read the original article Hit count: 196

Filed under:
|
|

For a type of nodes in my graph, attribute values for an attribute(named 'some_count') is either missing or an integer or a float. I'm trying to write gremlin to filter these nodes based on minimum value for this attribute.

I first verified that the values are indeed present by firing the following gremlin

g.v(XXX)._().in('category').hasNot('some_count', T.eq, null).back(1).some_count

Next,

I tried filtering by exact value and that works and show me the matching nodes or gives an empty array if there is no match

g.v(XXX)._().in('category').hasNot('some_count', T.eq, null).back(1).has('some_count', T.eq, 120000.0d)

But the following query that uses the 'greater than or equal to' comparator doesn't work.

g.v(XXX)._().in('category').hasNot('some_count', T.eq, null).back(1).has('some_count', T.gte, 1.0d) this returns nil (I'm querying via ruby/rails using Neo4j AR Adapter )

Instead of returning an empty array for no match, it returns a nil, which tells me something could be wrong with the query itself. I'm running neo4j community server 1.8.

Is there a way I can ask Neo4j to log errors/queries, to see what could be going wrong ?

© Stack Overflow or respective owner

Related posts about graph

Related posts about neo4j