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
REST API - delete all nodes and relationships ( preferably thru Cypher)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  15 messages - Collapse all  -  Translate all to Translated (View all originals)
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
 
Aidan Casey  
View profile  
 More options Jul 18 2012, 6:49 am
From: Aidan Casey <aidanca...@gmail.com>
Date: Wed, 18 Jul 2012 03:49:36 -0700 (PDT)
Local: Wed, Jul 18 2012 6:49 am
Subject: REST API - delete all nodes and relationships ( preferably thru Cypher)

I'm running Neo4J on Heroku and accessing it through the REST API (node.js
client).

I can't figure out how to delete all nodes and all relationships in the
database except for node 0.

Basically I want to clear all the data out of my database and repopulate it
several times during development - is this possible through a cypher query
or through the REST API???

thanks

Aidan


 
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.
Julian Simpson  
View profile  
 More options Jul 18 2012, 9:22 am
From: Julian Simpson <julian.simp...@neotechnology.com>
Date: Wed, 18 Jul 2012 14:22:37 +0100
Local: Wed, Jul 18 2012 9:22 am
Subject: Re: [Neo4j] REST API - delete all nodes and relationships ( preferably thru Cypher)

On Wed, Jul 18, 2012 at 11:49 AM, Aidan Casey <aidanca...@gmail.com> wrote:
> I'm running Neo4J on Heroku and accessing it through the REST API (node.js
> client).

> I can't figure out how to delete all nodes and all relationships in the
> database except for node 0.

> Basically I want to clear all the data out of my database and repopulate
> it several times during development - is this possible through a cypher
> query or through the REST API???

Here's what I've been using (for the exact same reasons as you):

START n=node(*)
MATCH n-[r?]-()
WHERE ID(n) <> 0
DELETE n,r

Best

Julian.

> thanks

> Aidan

--
*Julian Simpson* *
**Software Engineer | Neo Technology*
+447967189579 | @builddoctor
*As a friend of Neo, register for GraphConnect <http://graphconnect.com/> and
get a 20% discount. Code: GCFON*

 
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.
Aidan Casey  
View profile  
 More options Jul 21 2012, 5:26 am
From: Aidan Casey <aidanca...@gmail.com>
Date: Sat, 21 Jul 2012 02:26:13 -0700 (PDT)
Local: Sat, Jul 21 2012 5:26 am
Subject: Re: REST API - delete all nodes and relationships ( preferably thru Cypher)

Fantastico !!!
thanks for the swift reply!


 
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.
Nigel Small  
View profile  
 More options Jul 21 2012, 6:48 am
From: Nigel Small <ni...@nigelsmall.net>
Date: Sat, 21 Jul 2012 11:48:08 +0100
Local: Sat, Jul 21 2012 6:48 am
Subject: Re: [Neo4j] Re: REST API - delete all nodes and relationships ( preferably thru Cypher)

Since a complete clear down of the graph (except ref node) seems to be a
very common requirement, I've just added a helper method to py2neo to do
this, called "clear":

https://github.com/nigelsmall/py2neo/blob/master/src/py2neo/neo4j.py#...

Will be available in the next release.

Cheers
Nige

On 21 July 2012 10:26, Aidan Casey <aidanca...@gmail.com> wrote:


 
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.
S B  
View profile  
 More options Aug 7 2012, 4:47 am
From: S B <stefan.ber...@rechaoss.com>
Date: Tue, 7 Aug 2012 01:47:10 -0700 (PDT)
Local: Tues, Aug 7 2012 4:47 am
Subject: Re: [Neo4j] Re: REST API - delete all nodes and relationships ( preferably thru Cypher)

Nigel,
I would add a 'force=False' in the prototype of the function just to make
sure that people really know what they are doing. If you are just fiddling
with the library and trying the functions you might create disaster.

Stefan


 
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.
Nigel Small  
View profile  
 More options Aug 7 2012, 3:54 pm
From: Nigel Small <ni...@nigelsmall.net>
Date: Tue, 7 Aug 2012 20:54:01 +0100
Local: Tues, Aug 7 2012 3:54 pm
Subject: Re: [Neo4j] Re: REST API - delete all nodes and relationships ( preferably thru Cypher)

Hi Stefan

I'm afraid I have to disagree on this point. If someone is testing out the
library, I would hope that they wouldn't be doing so against a production
database. Also, the mechanism that you suggest would also not create any
real kind of barrier to accidental damage and would merely introduce
unnecessary noise into the function signature.

Nige

On 7 August 2012 09:47, S B <stefan.ber...@rechaoss.com> wrote:


 
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.
Christopher Hydak  
View profile  
 More options Sep 20 2012, 2:43 pm
From: Christopher Hydak <chy...@identropy.com>
Date: Thu, 20 Sep 2012 11:43:46 -0700 (PDT)
Local: Thurs, Sep 20 2012 2:43 pm
Subject: Re: [Neo4j] Re: REST API - delete all nodes and relationships ( preferably thru Cypher)

That method did not work for me.  I'm accessing neo (1.7.2) through the
shell and all it gives me is this error message:
*SyntaxException: expected return clause*

Does 1.7.2 not support DELETE?


 
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.
Michael Hunger  
View profile  
 More options Sep 20 2012, 3:03 pm
From: Michael Hunger <michael.hun...@neotechnology.com>
Date: Thu, 20 Sep 2012 21:05:20 +0200
Local: Thurs, Sep 20 2012 3:05 pm
Subject: Re: [Neo4j] REST API - delete all nodes and relationships ( preferably thru Cypher)

Christopher,

if you just need it in a testing environment, perhaps my test-delete-db extension helps you.

https://github.com/jexp/neo4j-clean-remote-db-addon

Binary downloads: https://github.com/jexp/neo4j-clean-remote-db-addon/downloads

Michael

Am 20.09.2012 um 20:43 schrieb Christopher Hydak:


 
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.
Christopher Hydak  
View profile  
 More options Sep 20 2012, 3:22 pm
From: Christopher Hydak <chy...@identropy.com>
Date: Thu, 20 Sep 2012 12:22:07 -0700 (PDT)
Local: Thurs, Sep 20 2012 3:22 pm
Subject: Re: [Neo4j] REST API - delete all nodes and relationships ( preferably thru Cypher)

That did not work for me.  I have version 1.7.2 but I tried your 1.6 and
1.8 versions.


 
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.
Michael Hunger  
View profile  
 More options Sep 20 2012, 3:29 pm
From: Michael Hunger <michael.hun...@neotechnology.com>
Date: Thu, 20 Sep 2012 21:31:59 +0200
Local: Thurs, Sep 20 2012 3:31 pm
Subject: Re: [Neo4j] REST API - delete all nodes and relationships ( preferably thru Cypher)

Uploaded one for 1.7

Michael

Am 20.09.2012 um 21:05 schrieb Michael Hunger:


 
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.
Christopher Hydak  
View profile  
 More options Sep 20 2012, 4:22 pm
From: Christopher Hydak <chy...@identropy.com>
Date: Thu, 20 Sep 2012 13:22:16 -0700 (PDT)
Local: Thurs, Sep 20 2012 4:22 pm
Subject: Re: [Neo4j] REST API - delete all nodes and relationships ( preferably thru Cypher)

Thanks.  It's still not working though.  I've double-checked each line but
still no dice.


 
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.
Christopher Hydak  
View profile  
 More options Sep 20 2012, 4:24 pm
From: Christopher Hydak <chy...@identropy.com>
Date: Thu, 20 Sep 2012 13:24:55 -0700 (PDT)
Local: Thurs, Sep 20 2012 4:24 pm
Subject: Re: [Neo4j] REST API - delete all nodes and relationships ( preferably thru Cypher)

Here is the command and the output I'm getting:

<https://lh4.googleusercontent.com/-Fc0rWrb9Ums/UFt7dDWce3I/AAAAAAAAAB...>

 curl -X DELETE http://localhost:7474/db/data/cleandb/Bcg4k824
{
  "node-indexes" : [ ],
  "nodes" : 0,
  "relationship-indexes" : [ ],
  "relationships" : 0,
  "maxNodesToDelete" : 1000


 
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.
Michael Hunger  
View profile  
 More options Sep 20 2012, 4:36 pm
From: Michael Hunger <michael.hun...@neotechnology.com>
Date: Thu, 20 Sep 2012 22:38:56 +0200
Local: Thurs, Sep 20 2012 4:38 pm
Subject: Re: [Neo4j] REST API - delete all nodes and relationships ( preferably thru Cypher)

The display in the webadmin-monitoring is actually the "highest-id in use". Not the actual number of nodes & rels.

You can check with a cypher read query that they are gone.

Michael

Am 20.09.2012 um 22:24 schrieb Christopher Hydak:


 
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.
Christopher Hydak  
View profile  
 More options Sep 20 2012, 4:56 pm
From: Christopher Hydak <chy...@identropy.com>
Date: Thu, 20 Sep 2012 13:56:32 -0700 (PDT)
Local: Thurs, Sep 20 2012 4:56 pm
Subject: Re: [Neo4j] REST API - delete all nodes and relationships ( preferably thru Cypher)

I think your code works, but there was something peculiar about my data
that I was trying to delete.  So, I completely deleted my database and had
neo4j recreate it.  Now, when I create nodes (1-6) I can run your command
and I'm back to 1.  Previously, I was never able to delete all of my data
for some reason.  There must have been something funky going on.

Just an FYI, I do not believe the statement you said is accurate about the
webadmin-monitoring.  After I created the 6 nodes (webadmin showed 7), I
deleted nodes 2-4 and webadmin showed 4.

Thanks for all of your help.


 
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.
Michael Hunger  
View profile  
 More options Sep 20 2012, 5:09 pm
From: Michael Hunger <michael.hun...@neotechnology.com>
Date: Thu, 20 Sep 2012 23:11:44 +0200
Local: Thurs, Sep 20 2012 5:11 pm
Subject: Re: [Neo4j] REST API - delete all nodes and relationships ( preferably thru Cypher)

You're welcome.

have fun and thanks for the feedback.

Michael

Am 20.09.2012 um 22:56 schrieb Christopher Hydak:


 
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.
End of messages
« Back to Discussions « Newer topic     Older topic »