I have addresses collection and a user can have multiple addresses. I want to set a limit of 20 addresses per user. This is also a potential security risk as one account may create as many records in the collection as allowed by the rate limit and thus potentially infinitely increasing the collection size.
TL;DR
Solution: To limit the number of documents a developer can create in a collection, you can use an Appwrite Function. In this case, the developer wants to set a limit of 20 addresses per user. This can be achieved by implementing rate limits and enforcing a maximum number of documents per user. By doing this, you can ensure that an account cannot create an unlimited number of records and potentially increase the collection size indefinitely. Keep in mind that rate limits should be configured appropriately to prevent abuse.