Only merge on keys not additional properties 
You could use an extra label for :Deleted 

Von meinem iPhone gesendet

> Am 09.08.2018 um 17:23 schrieb M <videm...@gmail.com>:
> 
> Hello,
> I'm working with a data model where entities have a set of common properties:
> 
> name
> created
> deleted
> 
> Deleted property is null until entity is soft-deleted, then null is set to 
> time stamp value.
> I'm using merge to avoid creating new entity if an existing one has the same 
> name:
> 
> merge (x:Thing{name: $name}) on create set created=timestamp()
> 
> This works fine until entity is deleted:
> 
> match (x:Thing{name: "someName"}) set x.deleted=timestamp();
> 
> I would like to add deleted property to merge criteria but I'm not sure how 
> to do that.
> Something like this (not a valid query):
> 
> merge (x:Thing{name EQUALS $name AND deleted IS NULL}) on create set 
> created=timestamp()
> 
> That way I could create new entity only if name does not exist or it exists 
> but entity has been deleted.
> I would appreciate any help in this matter.
> Thanks,
> 
> M
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Neo4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to neo4j+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to neo4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to