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 ๐
Recommended threads
- [SOLVED] Query.search() returning all ro...
When I use Query.search() instead of returning rows with the keywords provided it just returns all the rows in the table.
- 1:1 relationship doesnโt sync after re-a...
Hi, Iโm trying to use a two-way one-to-one relationship. It works fine when I create a record with the relationship set, and it also works when I unset it. But ...
- Upsert with setting permissions
Hi there, I am using self-hosted appwrite v1.7.4 and trying to use the bulk update stuff that was released with 1.7.x. Unfortunally I found that there is an ser...