# Convert property and all values to string inside graph db

**URL:** <https://community.neo4j.com/t/convert-property-and-all-values-to-string-inside-graph-db/19502>\
**Category:** Neo4j Graph Platform\
**Created:** [June 3, 2020, 11:57am UTC](https://community.neo4j.com/t/convert-property-and-all-values-to-string-inside-graph-db/19502 "2020-06-03T11:57:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rhys](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/rhys/32/11517_2.png) [@rhys](https://community.neo4j.com/u/rhys)\
**Post date:** [June 3, 2020, 11:57am UTC](https://community.neo4j.com/t/convert-property-and-all-values-to-string-inside-graph-db/19502/1 "2020-06-03T11:57:27Z")

</div>

Hello.

I have an existing graph database and a property that is a number. I realized after I created the database that I need that as a string. I can fix the code for new inserts but how do I convert, en mass, the existing data?

Thanks.  
Rhys

---

<div class="post-metadata">

**Author:** ![brant\_boehmann](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/brant_boehmann/32/71_2.png) [@brant\_boehmann](https://community.neo4j.com/u/brant_boehmann)\
**Post date:** [June 3, 2020, 12:25pm UTC](https://community.neo4j.com/t/convert-property-and-all-values-to-string-inside-graph-db/19502/2 "2020-06-03T12:25:12Z")

</div>

If your data set is small, you might be able to get by with something like:

```auto
MATCH (n:Label) 
SET n.property = toString(n.property)

```

However if your dataset is large and you can't sustain that in a single transaction, then the apoc.periodic.iterate would likely be of use to you. Modify the following. The first argument to the function to limit to exactly the smallest set that you can. The second argument to perform the mutation. The 3rd argument controls the batch size and concurrency of the overall operation.

```auto
CALL apoc.periodic.iterate(
  "MATCH (n:Label)
   RETURN n",
  "SET n.property = toString(n.property)"
  {batchSize:1000, iterateList: true, parallel: true, concurrency: 4}
);

```
