Hi Ben,

Have you looked at MERGE?
http://docs.neo4j.org/chunked/stable/query-merge.html

-Alistair



On 7 February 2014 15:58, Ben Titmarsh <[email protected]> wrote:

> Hello,
>
> Is it possible to write a semantic Upsert, i.e. update or insert if it
> doesn't exist using one cypher query?
>
> To give a bit of context, this is what I'm doing:
>
> MATCH (fromCard:Card)-[r:DECK_INCIDENCE]-(toCard:Card)
> WHERE fromCard.name in {...} and toCard.name in {...}
> SET r.passCount = r.passCount+1
>
> If the property passCount doesn't exist yet on the relationship then I'd
> like to set it to 1.
>
> Is it possible to achieve an upsert using one query?
>
> Cheers,
> Ben.
>
> --
> 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 [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to