I wonder how to model a scenario for a Chat-App, with different Threads and a list of allowed contributors. I would create a collection posts storing all posts for every thread.
Since I would like to list all Threads as well I wanted to create collection threads storing all thread-related metadata. Every post would reference the thread it belongs to.
I want to have a list of users allowed to post to given thread. Now what ?
If I add a field contributors to documents in threads I would need to do a query, if the current logged-in user is in the contributors list of the thread the new post belongs to on every insert. Is this a good Idea ?