# Uid functionality in multiple mutations

**URL:** <https://discuss.dgraph.io/t/uid-functionality-in-multiple-mutations/10916>\
**Category:** Dgraph\
**Tags:** kind:question, area:querylang\
**Created:** [October 13, 2020, 11:22am UTC](https://discuss.dgraph.io/t/uid-functionality-in-multiple-mutations/10916 "2020-10-13T11:22:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dewwrat](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/dewwrat/32/5038_2.png) [@dewwrat](https://discuss.dgraph.io/u/dewwrat)\
**Post date:** [October 13, 2020, 11:22am UTC](https://discuss.dgraph.io/t/uid-functionality-in-multiple-mutations/10916/1 "2020-10-13T11:22:09Z")

</div>

With this mutation, the Graph is plotted as two different bookings but sharing the same vehicle and the driver

```auto
{
  "set": [{
        "crn": 4820651604,
  			"uid" : "_:4820651604",
        "vehicle": [
            {
                "uid": "_:ABCD",
                "car_number": "ABCD",
                "original_car_category": "luxury_sedan"
            }
        ],
        "driver": [
            {
                "uid": "_:1350000000227531",
                "driver_imei": "1350000000227531"
            }
        ]
        },
        {
        "crn": 4820651605,
  			"uid" : "_:4820651605",
        "vehicle": [
            {
                "uid": "_:521XEN",
                "car_number": "521XEN",
                "original_car_category": "luxury_sedan"
            }
        ],
        "driver": [
            {
                "uid": "_:1350000000227531",
                "driver_imei": "1350000000227531"
            }
        ]
    }
]
}

```

Query

```auto
{
  view_booking(func: has(crn)) {
    crn
    vehicle {
      uid
      name: car_number
      original_car_category
    }
    driver {
      name: driver_imei
    }
  }
}

```

While trying to insert data as two separate mutate operation, the Graph is getting plotted as two different bookings, also two different vehicles and driver (even if their uid passed is the same)

How can I make sure same manual uid passed will be the only identifier even in multiple mutation

---

<div class="post-metadata">

**Author:** ![anand](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/anand/32/5674_2.png) [@anand](https://discuss.dgraph.io/u/anand)\
**Post date:** [October 14, 2020, 4:33am UTC](https://discuss.dgraph.io/t/uid-functionality-in-multiple-mutations/10916/2 "2020-10-14T04:33:59Z")

</div>

Hi @dewwrat  
The uid blank node ("\_:xxx") is not compared across transactions. Please review the [upsert](https://dgraph.io/docs/mutations/upsert-block/) block that helps in these scenarios. It allows you to retrieve the uid based on a query use in the mutation (update if uid exists, or insert a new node).
