# Merging nodes

**URL:** <https://discuss.dgraph.io/t/merging-nodes/14729>\
**Category:** Dgraph\
**Created:** [June 25, 2021, 10:18am UTC](https://discuss.dgraph.io/t/merging-nodes/14729 "2021-06-25T10:18:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kuririn](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/kuririn/32/8416_2.png) [@Kuririn](https://discuss.dgraph.io/u/Kuririn)\
**Post date:** [June 25, 2021, 10:18am UTC](https://discuss.dgraph.io/t/merging-nodes/14729/1 "2021-06-25T10:18:19Z")

</div>

It’s possible to merge two nodes?

I have a problem with duplicated nodes (same nodes but different uids). Some data is pointing to one node and some to another. I want all of this data to point to the one node.

How to write a query that will change all of the particular uid occurrences to another uid?It’s possible to replace uid?

I probably coud do it like this:

```auto
set {
   <0x25409d089> uid NEW_UID .
}

```

But I’m also wondering how to do it for the edges (nodes with fields that are set to this particular uid).

---

<div class="post-metadata">

**Author:** ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Post date:** [June 25, 2021, 12:45pm UTC](https://discuss.dgraph.io/t/merging-nodes/14729/2 "2021-06-25T12:45:37Z")

</div>

It is kind of possible, but you would do in one by one manner. Using Upsert Block.

Please read this [Bug with multi-level (nested bocks) in Upsert Block](http://discuss.hypermode.com/t/bug-with-multi-level-nested-bocks-in-upsert-block/8482)  
The part “Just an Update”.

---

<div class="post-metadata">

**Author:** ![Kuririn](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/kuririn/32/8416_2.png) [@Kuririn](https://discuss.dgraph.io/u/Kuririn)\
**Post date:** [June 25, 2021, 4:31pm UTC](https://discuss.dgraph.io/t/merging-nodes/14729/3 "2021-06-25T16:31:58Z")

</div>

Ok, thanks
