Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
07-15-2021 03:34 AM
Hi Team,
Need your help in knowing the query to delete a list of nodes passed as an argument to cypher query to delete them from given label.
Regards
Akshat
Solved! Go to Solution.
07-15-2021 08:01 AM
MATCH (n:DATALABEL)
WHERE n.TYPE = 'MDS'
WITH n
LIMIT 5
DETACH DELETE n
07-15-2021 04:10 AM
07-15-2021 05:20 AM
Hi Cobra,
Thank you for quick input.
I am aware with REMOVE / DELETE clause. Here , I need the REMOVAL of list of NODES from specific label.
List of nodes means 100 nodes or 50 nodes at a time eligible for deletion.
So in a nutshell , First Query gives the output of nodes for deletion and Second query takes the output of First query and use as an input and performs deletion.
I hope it makes sense.
Regards
Akshat
07-15-2021 05:27 AM
I'm not sure you can pass nodes as parameters, are you forced to do two queries or we can propose a solution with one query?
Can you give the RETURN
clause of the first query?
07-15-2021 06:53 AM
Hi Cobra,
Below is my Query and Its output -
Query - MATCH (n:DATALABEL) where n.TYPE = 'MDS' RETURN n.NAME LIMIT 5
Output -
"IJAMBDSRSWTW0002ENBMDS001"
"IDLHICHDPNB0005ENBMDS001"
"NASDBRGXXXXNB0001ENTMDS002"
"IASDBRGXXXXNB0001ENTMDS001"
"GJGDHWXXXXTW0007ENBMDS001"
Regards
Akshat
07-15-2021 07:08 AM
And you want to delete the node or only the label?
MATCH (n:DATALABEL)
WHERE n.TYPE = 'MDS'
WITH n
LIMIT 5
REMOVE n:DATALABEL
07-15-2021 07:54 AM
Hi Cobra ,
I want to delete the nodes.
Regards
Akshat
07-15-2021 08:01 AM
MATCH (n:DATALABEL)
WHERE n.TYPE = 'MDS'
WITH n
LIMIT 5
DETACH DELETE n
07-15-2021 08:19 AM
Thanks Cobra,
I will run and check the result.
Thanks Again.
Regards
Akshat
All the sessions of the conference are now available online