How to set a unique field in the mongodb rust implementation?
Are you supposed to use create_index()?
async fn create_id_fields(client: Client) -> Result {
let a = doc! {"my_id" => "1"}.unwrap;
client
.database(DB_NAME)
.collection(COLL_NAME_TICKET)
.create_index(a, unique = true)
.await;
}
Thanks for any hint!