Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Delete operation in SDN using cypher
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Michael Hunger  
View profile  
 More options Sep 27 2012, 10:18 am
From: Michael Hunger <michael.hun...@neotechnology.com>
Date: Thu, 27 Sep 2012 07:18:14 -0700
Local: Thurs, Sep 27 2012 10:18 am
Subject: Re: [Neo4j] Delete operation in SDN using cypher

Something like:

> START a=node(1)
> MATCH (a)-[rels*0..]-(z)
> FOREACH(rel IN rels: DELETE rel)
> DELETE a

       WITH z
       where z-->()

> DELETE z

Michael

Am 26.09.2012 um 06:43 schrieb Abdul Azeez Shaik:

> Hi Nigel,

> Thanks for the reply. I tried executing in latest 1.8RC1 webconsole, it gives me following error,
> TransactionFailureException: Unable to commit transaction

> Also, Do we need to use FOREACH in this case? Can't we directly use DELETE a,rels,z?
> In my case a and z are also collections, not single node.

> Thanks,
>  Abdul

> On Wed, Sep 26, 2012 at 4:49 PM, Nigel Small <ni...@nigelsmall.net> wrote:
> Hi Abdul

> I have recently added cascading deletion to py2neo. I use the following Cypher query...

> START a=node(1)
> MATCH (a)-[rels*0..]-(z)
> FOREACH(rel IN rels: DELETE rel)
> DELETE a, z

> ...where the first line determines the start node by ID. I have also considered looking at limits on relationship type and direction as well as a maximum cascade limit so you may want to consider that too.

> Cheers
> Nige

> On 26 September 2012 11:33, Abdul Azeez Shaik <azeeztechni...@gmail.com> wrote:
> Dear all,

> Can i delete a node along with its relationships and children using the following CYPHER query,
> "START g = node:galleryid(galleryid="0511a491-62ea-41f6-9a6f-b9060e3c525a") MATCH g-[r]-p DELETE g, r, p"

> Its not working when i tried this in webconsole of neo4j.
> I am trying to find where i can delete a node with all its children at one go.
> Or do i need to delete each children and its relationships, and then finally parent node.

> Kindly let me know your suggestions.

> Thanks,
> Abdul

> --

> --

> --


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.