Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 Feature: Self-relations for database #7455

Open
2 tasks done
zerogravity2020 opened this issue Jan 15, 2024 · 2 comments
Open
2 tasks done

🚀 Feature: Self-relations for database #7455

zerogravity2020 opened this issue Jan 15, 2024 · 2 comments
Labels
enhancement New feature or request product / databases Fixes and upgrades for the Appwrite Database.

Comments

@zerogravity2020
Copy link

🔖 Feature description

I see that at this time we can't create a self-relation between one collection

🎤 Pitch

Collection
products: { $id: .... products: [$id] }
Example https://www.prisma.io/docs/orm/prisma-schema/data-model/relations/self-relations

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@gewenyu99
Copy link

The proper way to do this is through a relationship table. The ERD should look like this:

image

{ user:
  [
    follower:
      [
        user1: {...}
        user2: {...}
        user3: {...}
      ]
   ]
}

user -> related to -> follower -> related to -> user. The followers table would help track user -> user self-relations.

@zerogravity2020
Copy link
Author

Hi @gewenyu99 - thanks for the update. Also filters queries doesn't work with related items. It's also huge problem :/

@EVDOG4LIFE EVDOG4LIFE added enhancement New feature or request product / databases Fixes and upgrades for the Appwrite Database. labels Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request product / databases Fixes and upgrades for the Appwrite Database.
Projects
None yet
Development

No branches or pull requests

3 participants