How to ignore null and empty value when use Neo4jOperations.save() to update properties with Spring Data Neo4j? -


spring-data-neo4j : 4.1.2
neo4j:3.0.3

node :

person {id:1, name:"aa", cover:"1.jpg"} 

class:

@nodeentity public class person{     @graphid     private long id;     private string name;     private string cover;     ... } 

new object:

person p = new person(); p.setid(1); p.setname("bb"); 

then update data:

p = neo4joperations.save(p,0); 

or:

personrepo.save(p,0); // interface extends graphrepository<person> 

result:

person {id:1, name:"bb"} 

question: cover property has been deleted,because p.cover null. there way can ignore null value when update?

no, not supported in sdn. null value means property removed underlying graph.

you can still write custom cypher query though (this defeat purpose of sdn if major use case)


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -