Thanks Michael !! It worked for me.

-Sukaant Chaudhary
<http://in.linkedin.com/pub/sukaant-chaudhary/33/ba8/479>

On Thu, Feb 19, 2015 at 4:37 AM, Michael Hunger <
[email protected]> wrote:

> It merges on all the information WITHIN the merge statement, if you want
> serviceId to be a key-property to merge on, pull it in.
>
> Oh and you _should_ use parameters !!!
>
> like this:
>
>
> MATCH (ageGroup:AgeGroup {ageGroup: "BETWEEN_25_TO_34"}),
> (action:Action {action: "Like"})
> MERGE (action)<-[relationAction:HAS_CHANNEL_ACTION
> {serviceId:{serviceId}]-(ageGroup)
> ON CREATE SET relationAction.date = "2015-01-29"
> ON CREATE SET relationAction.reach = 1
> ON MATCH SET relationAction.reach = relationAction.reach + 1
> RETURN relationAction
>
> Am 18.02.2015 um 10:57 schrieb Sukaant Chaudhary <
> [email protected]>:
>
> Hi,
> First time when I run the following query then it works fine,
> MATCH (ageGroup:AgeGroup {ageGroup: "BETWEEN_25_TO_34"}),
> (action:Action {action: "Like"})
> MERGE (action)<-[relationAction:HAS_CHANNEL_ACTION]-(ageGroup)
> ON CREATE SET relationAction.serviceId = "2002"
> ON CREATE SET relationAction.date = "2015-01-29"
> ON CREATE SET relationAction.reach = 1
> ON MATCH SET relationAction.reach = relationAction.reach + 1
> RETURN relationAction
>
> but second time it does not create the new one, it directly add into the
> previous one irrespective of different data, here *serviceId* is
> different.
>
> MATCH (ageGroup:AgeGroup {ageGroup: "BETWEEN_25_TO_34"}),
> (action:Action {action: "Like"})
> MERGE (action)<-[relationAction:HAS_CHANNEL_ACTION]-(ageGroup)
> ON CREATE SET relationAction.serviceId = "2000"
> ON CREATE SET relationAction.date = "2015-01-29"
> ON CREATE SET relationAction.reach = 1
> ON MATCH SET relationAction.reach = relationAction.reach + 1
> RETURN relationAction
>
> Please help me to solve the above issue.
>
> -Sukaant Chaudhary
> <image004.png> <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.
>

-- 
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.

Reply via email to