We have a requirement that the value of a particular field in documents of a collection need to be unique. This collection is partitioned, so I cannot write a trigger or SP to ensure this before each insert (as I want to ensure the uniqueness for whole collection and not just the partition). 

I've come across the following links where it is mentioned that there is a uniqueKeyPolicy which can be added to a collection , but couldn't see any examples or more info in official documentation. 

What's the best way to do this?

Information I found: 
<https://github.com/Azure/azure-documentdb-dotnet/blob/master/changelog.md> - Adds the ability to specify unique indexes for the documents by using UniqueKeyPolicy property on the DocumentCollection.

<https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.documents.uniquekeypolicy.uniquekeys?view=azure-dotnet>

<https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.documents.uniquekey?view=azure-dotnet>

Update: After some trying, I was able to do this using the DocumentClient from my .NET code while creating a new collection(Non Partitioned) . But is there a way to add this constraint for an existing collection. Also I couldn’t find a way of doing this from the portal. Is there any particular place I should be looking?