0

I'm using SDN 4 with Java 8.

I'm testing this code. I have two owner and each owner have one truck.

repository.findAll(1).forEach(owner -> {
    logger.info(owner.toString());
});

I expect logging two rows(owner). however It prints 4 rows.(twice each owner)

repository.findAll(0).forEach(owner -> {
    logger.info(owner.toString());
});

I changed depth to 0. It print 2 rows that i expect.

Why first code print 4 rows? Is it spec something i didn't know? When I run first code. It use this CQL

MATCH (n:`Owner`) WITH n MATCH p=(n)-[*0..1]-(m) RETURN p

and I testing this query to browser, It's show Owner and related truck. when I changed rows view mode. It return 4 rows.

Luanne
  • 19,145
  • 1
  • 39
  • 51
reperion
  • 129
  • 9

1 Answers1

1

What you're seeing is that a custom depth brings in related nodes, so the number of paths increase. The number of distinct nodes of type Owner were not returned correctly.

But, this issue was fixed- please upgrade to use neo4j-ogm 1.1.5 or SDN 4.1 (4.1.0.M1).

Luanne
  • 19,145
  • 1
  • 39
  • 51