Custom property added that to be unique for all users

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?

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: