I have an events collection where i need to have a unique constraint but conditionally, so i hav an event which can have many records but i need to only have 1 customer per event, how is this done using mongo indexes to avoid duplicate entries
{
event: "Rolling stones",
customer_id: 1,
},
{
event: "Rolling stones",
customer_id: 1,
},
{
event: "Rolling stones",
customer_id: 2,
},
{
event: "Rolling stones",
customer_id: 3,
},