Create new sparse, unique index in Mongo CLoud

Can anyone indicate the right way to create an index for a field that is both sparse and unique, in Mongo Cloud, using the web interface?

Basically I want it so when a value is provided for the field it is unique, but it may be null and null does not count towards duplicates.

What I have tried:

{
  "mobile": {
      "sparse": true,
      "unique": true
  }
}
{
  "mobile": ["sparse", "unique"]
}

Also this should have worked as basic.

{
  "mobile": "unique"
}

No errors, but no index on mobile field either. I had one previously, but removed it since it was only set to unique.

The only possibility that could maybe be causing a problem (which it should not), is a text index “name_text_mobile_text”, given I just had a mobile only index before removing it for rebuilding?

I did try reading the documentation reference from the dialogue, but it doesn’t give anything useful contextually for the fields in that dialogue.

Hi @Andre-John_Mas,

You need to use the Data Explorer and specify the field with its index order (ASC 1, DESC -1)

{
mobile : 1
}

And in the option section you need to specify both sparse and unique as true:

{
      "sparse": true,
      "unique": true
  }

Screen Shot 2020-08-26 at 17.14.35

More info here: https://docs.cloudmanager.mongodb.com/data-explorer/indexes/index.html#optional-specify-the-index-options

Best regards,
Pavel