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
- Attributes Confusion
```import 'package:appwrite/models.dart'; class OrdersModel { String id, email, name, phone, status, user_id, address; int discount, total, created_at; L...
- 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.