And docker logs appwrite
See what error shows there
but if i dont choose unique then its working fine why?
should i run this in terminal ? docker logs appwrite-worker-databases
Yes
Thanks @Binyamin its working fine, but there is one problem
AppwriteException: document_already_exists, Document with the requested ID already exists. (409)
That's good
Then you should tell the user the that attributes is already exists
if i loged in with different account and want to create same record for that user in that is also giving me error that what i was talking previously.
hope this time you got my point, apologies if i have not explain it properly
Got it
You want it to be unique per user?
yes
Good. Then delete the newly added index.
Then, create a new one and add both attributes to the index
- user ID
- the attribute
thanks, as of now i am not storing the user id to any attribute
So how you know which document to which?
you might be amaze as i am segregating the users data by permission
That's fine
But in your case I guess you'll need to add another field to be able to have a unique index that it's based on two attributes
ok, i got your point thanks for your time,
Thanks, this is working
Great
using Appwrite DB or an external database like MariaDB which is better
Appwrite databse is indeed MariaDB If you want and your project grows it might be better to decentraliz the MariaDB into a separate node or a managed one.
You can read a lot about it https://discord.com/channels/564160730845151244/1097119647867863090
Recommended threads
- Bug report: Race condition in Flutter SD...
Hi team, I've found an intermittent bug in the Flutter SDK (v20.3.0) when using `createOAuth2Session` on Android. **Symptoms** After `createOAuth2Session` re...
- Help Needed: "The current user has been ...
Facing a 403 Forbidden error with the message "The current user has been blocked" while trying to log in via GitHub and Email/Password. This is happening on a ...
- Unable to signup to appwrite cloud
When attempting to create an online cloud account on appwrite.io, I get the following message : "This email address must already be in its canonical form. Pleas...