Assuming you have some unique way of matching the nodes you want, you could
do something like this:
MERGE (n:Count { uid: 3 })
ON MATCH SET n.count = n.count + {increment}
ON CREATE SET n.count = {increment}
RETURN n;
On Tue, Sep 9, 2014 at 7:39 AM, Sukaant Chaudhary <
[email protected]> wrote:
> Hi,
> I'm using the following query:
>
> MERGE (count:Count {count: {count}})
> RETURN count;
>
> But my requirement is like:
> Suppose *count = 10* it is already there in the db, no if I'll store
> again *count = 2*, then in my case the value of count will be 2, in new
> node, but I want the value of count should become *count = 12* in the
> same node.
>
> Please help how to get this.
>
> -Sukaant Chaudhary
> <http://in.linkedin.com/pub/sukaant-chaudhary/33/ba8/479>
>
> --
> 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/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 [email protected].
For more options, visit https://groups.google.com/d/optout.