# How to delete a list of nodes from Label

**URL:** <https://community.neo4j.com/t/how-to-delete-a-list-of-nodes-from-label/41416>\
**Category:** Cypher\
**Created:** [July 15, 2021, 10:34am UTC](https://community.neo4j.com/t/how-to-delete-a-list-of-nodes-from-label/41416 "2021-07-15T10:34:21Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![akshat\_mittal](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/akshat_mittal/32/4359_2.png) [@akshat\_mittal](https://community.neo4j.com/u/akshat_mittal)\
**Post date:** [July 15, 2021, 10:34am UTC](https://community.neo4j.com/t/how-to-delete-a-list-of-nodes-from-label/41416/1 "2021-07-15T10:34:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Cobra](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/cobra/32/35243_2.png) [@Cobra](https://community.neo4j.com/u/Cobra)\
**Post date:** [July 15, 2021, 11:10am UTC](https://community.neo4j.com/t/how-to-delete-a-list-of-nodes-from-label/41416/2 "2021-07-15T11:10:28Z")

</div>

Hello @akshat_mittal 🙂

I think you are looking for [REMOVE](https://neo4j.com/docs/cypher-manual/current/clauses/remove/#remove-remove-a-label-from-a-node) clause.

Regards,  
Cobra

---

<div class="post-metadata">

**Author:** ![akshat\_mittal](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/akshat_mittal/32/4359_2.png) [@akshat\_mittal](https://community.neo4j.com/u/akshat_mittal)\
**Post date:** [July 15, 2021, 12:20pm UTC](https://community.neo4j.com/t/how-to-delete-a-list-of-nodes-from-label/41416/3 "2021-07-15T12:20:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Cobra](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/cobra/32/35243_2.png) [@Cobra](https://community.neo4j.com/u/Cobra)\
**Post date:** [July 15, 2021, 12:27pm UTC](https://community.neo4j.com/t/how-to-delete-a-list-of-nodes-from-label/41416/4 "2021-07-15T12:27:24Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![akshat\_mittal](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/akshat_mittal/32/4359_2.png) [@akshat\_mittal](https://community.neo4j.com/u/akshat_mittal)\
**Post date:** [July 15, 2021, 1:53pm UTC](https://community.neo4j.com/t/how-to-delete-a-list-of-nodes-from-label/41416/5 "2021-07-15T13:53:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Cobra](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/cobra/32/35243_2.png) [@Cobra](https://community.neo4j.com/u/Cobra)\
**Post date:** [July 15, 2021, 2:08pm UTC](https://community.neo4j.com/t/how-to-delete-a-list-of-nodes-from-label/41416/6 "2021-07-15T14:08:33Z")

</div>

And you want to delete the node or only the label?

```auto
MATCH (n:DATALABEL)
WHERE n.TYPE = 'MDS'
WITH n
LIMIT 5
REMOVE n:DATALABEL

```

---

<div class="post-metadata">

**Author:** ![akshat\_mittal](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/akshat_mittal/32/4359_2.png) [@akshat\_mittal](https://community.neo4j.com/u/akshat_mittal)\
**Post date:** [July 15, 2021, 2:54pm UTC](https://community.neo4j.com/t/how-to-delete-a-list-of-nodes-from-label/41416/7 "2021-07-15T14:54:21Z")

</div>

Hi Cobra ,

I want to delete the nodes.

Regards  
Akshat

---

<div class="post-metadata">

**Author:** ![Cobra](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/cobra/32/35243_2.png) [@Cobra](https://community.neo4j.com/u/Cobra)\
**Post date:** [July 15, 2021, 3:01pm UTC](https://community.neo4j.com/t/how-to-delete-a-list-of-nodes-from-label/41416/8 "2021-07-15T15:01:45Z")

</div>

```auto
MATCH (n:DATALABEL)
WHERE n.TYPE = 'MDS'
WITH n
LIMIT 5
DETACH DELETE n

```

---

<div class="post-metadata">

**Author:** ![akshat\_mittal](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/akshat_mittal/32/4359_2.png) [@akshat\_mittal](https://community.neo4j.com/u/akshat_mittal)\
**Post date:** [July 15, 2021, 3:19pm UTC](https://community.neo4j.com/t/how-to-delete-a-list-of-nodes-from-label/41416/9 "2021-07-15T15:19:16Z")

</div>

Thanks Cobra,

I will run and check the result.

Thanks Again.

Regards  
Akshat
