I try to create a cypher-query in my Java-Spring-Application which should answer the question "give all employees who did not create a item in item.nameList":
@Query("START it=node:__types__(className = 'de.my.domain.ItemCl') MATCH empl-[r:CREATE]->it WHERE (it.name NOT IN ({0})) RETURN DISTINCT empl")
List<Employee> findAllEmployeesWhoNeverCreatedItemFromItemNameList(List<String> itemNameList);
This query gives an "org.springframework.dao.InvalidDataAccessResourceUsageException" and marks the "NOT" as failure.
If I try the same query without NOT ("give all employees who did create a item in item.nameList", the query does what it should.
In this thread Peter Neubauer told that this "NOT IN" exists in cypher: https://groups.google.com/forum/#!topic/neo4j/_PehVUfGaIA
Any idea what is wrong?
If the query is not already in the Execution Plan Cache, the query is compiled into an execution plan in the Neo4j DBMS. The execution plan executes in the Neo4j DBMS to retrieve data. The Page Cache is used to hold the data in memory.
Heap Sizing The size of the available heap memory is an important aspect for the performance of Neo4j. Generally speaking, it is beneficial to configure a large enough heap space to sustain concurrent operations. For many setups, a heap size between 8G and 16G is large enough to run Neo4j reliably.
The WITH clause allows query parts to be chained together, piping the results from one to be used as starting points or criteria in the next. It is important to note that WITH affects variables in scope.
NOT
is a negation, so you have to do it like this:
WHERE NOT(it.name IN({0}))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With