# Updating a node label from a property or creating an index

**URL:** <https://community.neo4j.com/t/updating-a-node-label-from-a-property-or-creating-an-index/27922>\
**Category:** Neo4j Graph Platform\
**Tags:** cypher\
**Created:** [October 27, 2020, 12:17am UTC](https://community.neo4j.com/t/updating-a-node-label-from-a-property-or-creating-an-index/27922 "2020-10-27T00:17:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bill\_dickenson](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/bill_dickenson/32/4915_2.png) [@bill\_dickenson](https://community.neo4j.com/u/bill_dickenson)\
**Post date:** [October 27, 2020, 12:17am UTC](https://community.neo4j.com/t/updating-a-node-label-from-a-property-or-creating-an-index/27922/1 "2020-10-27T00:17:37Z")

</div>

We have a property in our db that has gotten more important over time and we are searching on it a lot. We have been debating either making it a node label, or creating an index on the property. So if the structure were

a:ProgNode {KDM:p1, size:10,etc etc

Would we be better just creating an index on KDM or defining it like this

a:ProgNode:KDMVALUE {size:10, etc etc)

If the answer is define it as a label on Node, is there a simple cypher that can do it ? Thanks

---

<div class="post-metadata">

**Author:** ![intouch\_vivek](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/intouch_vivek/32/4097_2.png) [@intouch\_vivek](https://community.neo4j.com/u/intouch_vivek)\
**Post date:** [October 27, 2020, 1:41am UTC](https://community.neo4j.com/t/updating-a-node-label-from-a-property-or-creating-an-index/27922/2 "2020-10-27T01:41:03Z")

</div>

Hi @bill_dickenson,

I would suggest to have a look into the requirement and indexes in Neo4j.

> **[Labels and Schema Indexes in Neo4j](https://neo4j.com/news/labels-and-schema-indexes-in-neo4j/)**
>
> Neo4j recently introduced the concept of labels and their sidekick, schema indexes. Labels are a way of attaching one or more simple types to nodes (and relationships), while schema indexes allow to automatically index labelled nodes by one or more…...

OR  
Several other documents available at Neo4j.

Inshort, Label Index to restrict the Search on given Label and is nothing to do with property value present in the Label. On the other hand when you create a Explicit property index then your search will look into the index to fulfill the search result.

---

<div class="post-metadata">

**Author:** ![ameyasoft](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/ameyasoft/32/32639_2.png) [@ameyasoft](https://community.neo4j.com/u/ameyasoft)\
**Post date:** [October 27, 2020, 4:31am UTC](https://community.neo4j.com/t/updating-a-node-label-from-a-property-or-creating-an-index/27922/3 "2020-10-27T04:31:23Z")

</div>

Creating a unique constraint on a node property worked for me in a production environment.

---

<div class="post-metadata">

**Author:** ![bill\_dickenson](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/bill_dickenson/32/4915_2.png) [@bill\_dickenson](https://community.neo4j.com/u/bill_dickenson)\
**Post date:** [October 27, 2020, 3:42pm UTC](https://community.neo4j.com/t/updating-a-node-label-from-a-property-or-creating-an-index/27922/4 "2020-10-27T15:42:04Z")

</div>

Thank you all. That was very helpful.
