Having an array of emails on a document. How would we find another document in the same collection that shares at least one email in common?
Essentially we have a contacts collection and each contact document has an array of emailAddresses[]. We want to make sure no two contact documents have an email in common with another document, but we're unable to find where this is happening.