having some problems with cypher query and numeric indexes
@Indexed(unique = true, numeric = false)
private Long accountId;
Returns:
neo4j-sh (0)$ start n=node:Principal(accountId = '1') return n;
+---------------------------------------------------------------------------------------------+
| n |
+---------------------------------------------------------------------------------------------+
| Node[41722]{__type__:"example.package.Principal",accountId:1,name:"Simple User"} |
+---------------------------------------------------------------------------------------------+
1 row
But
@Indexed(unique = true, numeric = true)
private Long accountId;
Returns:
neo4j-sh (0)$ start n=node:Principal(accountId = '1') return n;
+---+
| n |
+---+
+---+
0 row
neo4j 1.9.2
spring-data-neo4j 2.3.0.RC1
If i understand correctly this might be ralted this discussion, but it is quite old?
UPDATE:
If i use
@Indexed(unique = true, numeric = false)
Another interesting thing happens. Checking if relationship exists (it actualy exists in db):
count(r) is equal to 0 - incorrect:
Long accountId = 1L;
Map<String, Object> result = template.query(
"START child=node:Principal(accountId='{childId}') " +
"MATCH child-[r:IS_MEMBER_OF]->parent " +
"RETURN count(r)", MapUtil.map("childId", accountId)).singleOrNull();
count(r) is equal to 1 - correct:
Long accountId = 1L;
Map<String, Object> result = template.query(
"START child=node:Principal(accountId='1') " +
"MATCH child-[r:IS_MEMBER_OF]->parent " +
"RETURN count(r)",null).singleOrNull();