For example
Org ID | Email 123 | moshontong@gmail.com 123 | moshontong@gmail.com
Now this throws an error, 123 | moshontong@gmail.com is duplicate. But if this is the case
Org ID | Email 123 | moshontong@gmail.com 021 | moshontong@gmail.com
OR Org ID | Email 123 | moshontong@gmail.com 123 | joshontong@gmail.com
This is still a unique data since the ORg ID or the Email are not the same to other that
Is this your custom collection?
yes
If you want org Id to be unique, create a unique index on org Id. Same with email
so what if I have moshontong email on two document but the org ids is not the same does it still throws an error?
Since the org ids are different the unique constraint will not apply. Both documents will be regarded as distinct.
This only applies if you create 1 unique index with both attributes.
If you have 1 index on email, no 2 document can have the same email
Yes, I'm aware of that 👍