# Custom property added that to be unique for all users

**URL:** <https://community.auth0.com/t/custom-property-added-that-to-be-unique-for-all-users/6165>\
**Category:** Get Help\
**Tags:** custom-property, unique-property, users, custom-login, custom-database\
**Created:** [April 9, 2017, 10:40am UTC](https://community.auth0.com/t/custom-property-added-that-to-be-unique-for-all-users/6165 "2017-04-09T10:40:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gocashpositive](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@gocashpositive](https://community.auth0.com/u/gocashpositive)\
**Post date:** [April 9, 2017, 10:40am UTC](https://community.auth0.com/t/custom-property-added-that-to-be-unique-for-all-users/6165/1 "2017-04-09T10:40:27Z")

</div>

Hi,  
here I have `mobile` as a custom property,

```
"user_metadata": {
    "mobile": "8373886873",
    "phone_verified": true
  },

```

and how can I make it unique among all the users `mobile` property?  
can I make this mobile number as a default login username instead of email?

---

<div class="post-metadata">

**Author:** ![prashantT](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/prashantt/32/6002_2.png) [@prashantT](https://community.auth0.com/u/prashantT)\
**Post date:** [April 10, 2017, 11:41am UTC](https://community.auth0.com/t/custom-property-added-that-to-be-unique-for-all-users/6165/2 "2017-04-10T11:41:46Z")

</div>

You will need to make a Management API call to ensure that `user_metadata.mobile` is unique. This can be done from your backend with the following Lucene syntax query, which will return any users that have the same phone number in `user_metadata.mobile`:

```
q=user_metadata.mobile:"MOBILE_NUMBER"

```

If you’d like to use the mobile phone number as the login username, you can use a database connection with `Requires username` enabled:

> **[Adding Username for Database Connections](https://auth0.com/docs/authenticate/database-connections/require-username)**
>
> Learn how to add a username field for login to database connections.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:53am UTC](https://community.auth0.com/t/custom-property-added-that-to-be-unique-for-all-users/6165/3 "2018-03-02T05:53:10Z")

</div>


