cypher query to get all entities for which a specific field null

29 views
Skip to first unread message

Eugen Paraschiv

unread,
Jun 12, 2012, 5:41:58 PM6/12/12
to ne...@googlegroups.com
Hi,
I'm trying to write a Cypher query to get all entities that have a specific field null;
entity is
Polygon{
    private Owner owner;
}
and the query should be:
getAllPolygonsWithNullOwner
Any help on this is appreciated.
Thanks.
Eugen.

Peter Neubauer

unread,
Jun 18, 2012, 7:43:38 AM6/18/12
to ne...@googlegroups.com
Eugen,
what are you using? Spring?

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

Eugen Paraschiv

unread,
Jun 18, 2012, 1:31:54 PM6/18/12
to ne...@googlegroups.com
Yes I am.
Exactly:
<neo4j.version>1.6.2</neo4j.version>
<neo4j-spatial.version>0.8</neo4j-spatial.version>
 <spring-data-neo4j.version>2.1.0.M1</spring-data-neo4j.version>
Eugen.

Michael Hunger

unread,
Jun 18, 2012, 3:28:40 PM6/18/12
to ne...@googlegroups.com
PolygonRepository extends GraphRepository<Polygon>{
  Iterable<Polygon> findByOwnerIsNull(); // willl work with primitive properties, but I'm not sure about references

  // this will work if I didn't put in a typo :)
  @Query("start n=__type__(className='com.examplePolygon') where not(n-[:OWNER]->()) return n"
  Iterable<Polygon> findByOwnerIsNull(); // willl work with primitive properties, but I'm not sure about references
Reply all
Reply to author
Forward
0 new messages