I am try to build a simple CRUD todo application using appwrite.I have a use case where where a user assign multiple tags to a given todo.I was hoping to have the type of tag as an array of strings (similar to Firestore) But appwrite does not seem to support raray of values as valid collection attribute type.How can i model this situation now?
Should i have another tags collection and userId as on one of the attribute of the tags collection? Do we have concept of foreign keys similar to mySQL?
What if i want to field is be one among give set of values (something like an enum ?)
Do i need to create index?primary keys?
I have exposure to relational database and often think in terms of relations and foreign key. I am front-end developer and my db skills are not that great. Any suggestion would be for great help.
Have you try to create a String type and mark it as array?
@Binyamin Thanks. Is it possible to nest collections as well? or have values as object?
You can't nest collection, AppWrite approach is to be fast as NoSql by providing NoSql-like syntax but eventually it's MariaDB (Relational) For the second question, there isn't any type for object, the only thing you can do is to create big string and put inside a serialized json.
I the next version we're going to experiment with allowing relationships. You can wait for that to happen 😉
nice thanks👍
Recommended threads
- Weird permission failure
when creating an account I use following methods: ``` Future<void> register(String email, String password, String username) async { final user = await accoun...
- Relation Question
How do I create a relation from table y to an others x.$id. in my example I have a users table where I use Appwrites unique User IDs and I want other tables fo...
- Unknown attribute type: varchar / text
Since the `string` type is deprecated I tried using `varchar` and `text` in some newer tables, but when running `appwrite pull tables && appwrite types ./src/li...