Ansh
i want to make a filed unique for eg username in a social media app how to make this field unique in appwrite
TL;DR
Solution: To make an attribute unique in Appwrite, you need to add a unique index to that attribute. Check the Appwrite documentation for indexes types (<https://appwrite.io/docs/databases#indexes>) and follow the steps mentioned there. This will ensure that any value inside that attribute is unique. In the case of making a username field unique in a social media app, you can add a unique index to the username attribute in the Appwrite collection. Binyamin
In a given collection?
Ansh
yes
Binyamin
Add a unqiue index to that attribute
Binyamin
This will make sure any value inside that attrubite will be unqiue
Ansh
ok
Binyamin
Check Appwrite indexes types
Drake
[SOLVED] how to make an attribute unique in appwrite
Recommended threads
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...
- Edit ID of an existing collection
Hi there. Is it possible to edit an ID of an existing collection? Right now it looks impossible from AppWrite cloud at least.
- Seed db
hello there... is this correct way to seed appwrite