Back

How does "restrict" work when defining document relationships?

  • 0
  • Databases
ericswpark
15 Feb, 2024, 15:23

If I have a "User" collection and a "Post" collection, and if I'm trying to define a many-to-many relation between the two, what is restricted exactly if I choose "restrict" for the document deletion setting? Does that mean posts cannot be deleted as long as they have authors, or vice versa?

TL;DR
In the support thread, a developer is asking how the "restrict" setting works when defining document relationships between the "User" and "Post" collections. They want to know what is restricted if they choose this option for document deletion. In response to their question, the "restrict" setting means that if a document is connected to another document through a relationship, it cannot be deleted as long as the relationship exists. In this case, if the developer chooses "restrict" for document deletion, posts cannot be deleted as long as they have authors, and vice versa. Solution: To implement the desired behavior, the developer can choose the "restrict
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more